run migrations via entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9cda832b82
commit
a92bf0a8c3
3 changed files with 11 additions and 2 deletions
|
|
@ -90,4 +90,4 @@ USER nobody
|
|||
# above and adding an entrypoint. See https://github.com/krallin/tini for details
|
||||
# ENTRYPOINT ["/tini", "--"]
|
||||
|
||||
CMD ["/app/bin/server"]
|
||||
ENTRYPOINT ["/app/bin/docker-entrypoint.sh"]
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ For testing the production Docker build locally:
|
|||
docker compose -f docker-compose.prod.yml up
|
||||
```
|
||||
|
||||
5. **Run database migrations:**
|
||||
5. **Database migrations run automatically** on app start. For manual migration:
|
||||
```bash
|
||||
docker compose -f docker-compose.prod.yml exec app /app/bin/mv eval "Mv.Release.migrate"
|
||||
```
|
||||
|
|
|
|||
9
rel/overlays/bin/docker-entrypoint.sh
Executable file
9
rel/overlays/bin/docker-entrypoint.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "==> Running database migrations..."
|
||||
/app/bin/migrate
|
||||
|
||||
echo "==> Starting application..."
|
||||
exec /app/bin/server
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue