run migrations via entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon 2025-12-04 18:02:47 +01:00
parent 9cda832b82
commit a92bf0a8c3
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
3 changed files with 11 additions and 2 deletions

View file

@ -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"]

View file

@ -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"
```

View file

@ -0,0 +1,9 @@
#!/bin/sh
set -e
echo "==> Running database migrations..."
/app/bin/migrate
echo "==> Starting application..."
exec /app/bin/server