Run database migrations on startup

Add railway.json config and update Dockerfile entrypoint to run
migrations before starting the server.
This commit is contained in:
2026-09-02 13:50:29 +09:00
parent 20375636b4
commit bd4e743a30
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -98,4 +98,4 @@ USER nobody
# above and adding an entrypoint. See https://github.com/krallin/tini for details
# ENTRYPOINT ["/tini", "--"]
CMD ["/app/bin/server"]
CMD ["/bin/sh", "-c", "/app/bin/migrate && /app/bin/server"]
+12
View File
@@ -0,0 +1,12 @@
{
"$schema": "https://railway.com/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "Dockerfile"
},
"deploy": {
"startCommand": "/app/bin/migrate && /app/bin/server",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}