fix: update Dockerfile to compile seed script and run it before starting the application

This commit is contained in:
Thibault Pouch
2026-03-26 13:28:40 +01:00
parent 600026d90c
commit d66424074c

View File

@@ -10,6 +10,7 @@ RUN npm ci
COPY . .
RUN npx prisma generate
RUN npm run build
RUN npx tsc --module commonjs --target ES2022 --esModuleInterop --skipLibCheck --outDir dist prisma/seed.ts
FROM node:22-slim
@@ -28,4 +29,4 @@ COPY prisma ./prisma
EXPOSE 3000
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/index.js"]
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/seed.js && node dist/index.js"]