From 7859932150a8442ff619f72fc15a89e018daf9ab Mon Sep 17 00:00:00 2001 From: Lawrence Davis Date: Sun, 21 Sep 2025 12:39:34 -0500 Subject: [PATCH] Run migrations before starting app --- Dockerfile | 4 +++- fly.toml | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ed03ecc..c6f8a3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,10 @@ RUN npm install --include=dev COPY . . RUN nx run-many -t build -p spin-cycle spin-cycle-client --prod -# Compile TypeORM migrations to JS for production runtime +# Compile TypeORM migrations to JS for production runtime and run migrations RUN npx tsc -p apps/spin-cycle/tsconfig.migrations.json +RUN npm run db:migrate:run + RUN cp -R dist/apps/spin-cycle-client dist/apps/spin-cycle/assets/ ENTRYPOINT ["node", "dist/apps/spin-cycle/main.js"] diff --git a/fly.toml b/fly.toml index 23369d7..23bb1a2 100644 --- a/fly.toml +++ b/fly.toml @@ -8,9 +8,6 @@ primary_region = 'ord' [build] -[deploy] - release_command = "npm run db:migrate:run" - [http_service] internal_port = 3000 force_https = true