Initial Commit
This commit is contained in:
@@ -44,6 +44,13 @@ RUN addgroup -g 1001 -S nodejs && \
|
||||
# Copy built application from builder stage
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
# Package migrations at a stable path used by migration runner
|
||||
# Copy both feature and core migrations so the runner can orchestrate order
|
||||
ENV MIGRATIONS_DIR=/app/migrations
|
||||
RUN mkdir -p /app/migrations/features /app/migrations/core
|
||||
COPY --from=builder /app/src/features /app/migrations/features
|
||||
COPY --from=builder /app/src/core /app/migrations/core
|
||||
|
||||
# Change ownership to non-root user
|
||||
RUN chown -R nodejs:nodejs /app
|
||||
|
||||
@@ -60,5 +67,5 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
# Use dumb-init for proper signal handling
|
||||
ENTRYPOINT ["dumb-init", "--"]
|
||||
|
||||
# Run production application
|
||||
CMD ["npm", "start"]
|
||||
# Run production application with auto-migrate (idempotent)
|
||||
CMD ["sh", "-lc", "node dist/_system/migrations/run-all.js && npm start"]
|
||||
|
||||
Reference in New Issue
Block a user