Skip to content

Commit

Permalink
fix: run DB migrations with Docker dev image
Browse files Browse the repository at this point in the history
Add `entrypoint.dev.sh`, which runs the Prisma migrations before `yarn dev` starts the dev server.

Use that as the entrypoint for development with Docker.
  • Loading branch information
eatyourgreens committed Feb 11, 2025
1 parent 1d5c580 commit e62eb37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
MATERIAL_METHOD: "pull"
MATERIAL_DIR: ".material"
YAML_TEMPLATE: "config/oxford.yaml"
command: "yarn dev"
command: "sh /app/entrypoint.dev.sh"
volumes:
- node-modules:/app/node_modules
- ./.material:/app/.material
Expand Down
6 changes: 6 additions & 0 deletions entrypoint.dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Run migrations on the database
npx prisma migrate deploy

yarn dev

0 comments on commit e62eb37

Please sign in to comment.