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:
+1
-1
@@ -98,4 +98,4 @@ USER nobody
|
|||||||
# above and adding an entrypoint. See https://github.com/krallin/tini for details
|
# above and adding an entrypoint. See https://github.com/krallin/tini for details
|
||||||
# ENTRYPOINT ["/tini", "--"]
|
# ENTRYPOINT ["/tini", "--"]
|
||||||
|
|
||||||
CMD ["/app/bin/server"]
|
CMD ["/bin/sh", "-c", "/app/bin/migrate && /app/bin/server"]
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user