fix: CI/CD permission fix
This commit is contained in:
@@ -51,6 +51,10 @@ 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
|
||||
|
||||
# Copy entrypoint script for permission checks
|
||||
COPY scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
# Change ownership to non-root user
|
||||
RUN chown -R nodejs:nodejs /app
|
||||
|
||||
@@ -64,8 +68,8 @@ EXPOSE 3001
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD node -e "require('http').get('http://localhost:3001/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"
|
||||
|
||||
# Use dumb-init for proper signal handling
|
||||
ENTRYPOINT ["dumb-init", "--"]
|
||||
# Use dumb-init with entrypoint for permission checks
|
||||
ENTRYPOINT ["dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"]
|
||||
|
||||
# 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