fix: run db migrations on startup in production
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-12-15 16:05:53 +01:00
parent aa5f2328f7
commit cd7707a725
4 changed files with 10 additions and 8 deletions
+4 -3
View File
@@ -6,8 +6,8 @@ WORKDIR /app
FROM base AS dependencies
COPY package.json package-lock.json ./
RUN npm ci --only=production && \
cp -R node_modules /tmp/prod_node_modules && \
npm ci
cp -R node_modules /tmp/prod_node_modules && \
npm ci
# Build stage
FROM base AS build
@@ -48,4 +48,5 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:5000/api/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
# Start the application using tsx to run TypeScript directly
CMD ["npx", "tsx", "server/index.ts"]
# Run DB migrations and start the application
CMD ["sh", "-c", "npx drizzle-kit push && npx tsx server/index.ts"]