From a39e4ca7f7e6aa832daae80deb0e18f9489a61bb Mon Sep 17 00:00:00 2001 From: Till JS Date: Sun, 15 Mar 2026 08:41:04 +0100 Subject: [PATCH] fix(calendar): fix Dockerfile healthcheck ports and add ENCRYPTION_KEY to prod - Backend/Web Dockerfiles: use PORT env var in healthcheck (was hardcoded) - Web Dockerfile: align default port to 5012 (matching docker-compose) - docker-compose.macmini.yml: add ENCRYPTION_KEY env var for calendar-backend Co-Authored-By: Claude Opus 4.6 --- apps/calendar/apps/backend/Dockerfile | 9 +++++---- apps/calendar/apps/web/Dockerfile | 11 +++++------ docker-compose.macmini.yml | 1 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/apps/calendar/apps/backend/Dockerfile b/apps/calendar/apps/backend/Dockerfile index cd8eba205..ae9edfa88 100644 --- a/apps/calendar/apps/backend/Dockerfile +++ b/apps/calendar/apps/backend/Dockerfile @@ -78,12 +78,13 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh WORKDIR /app/apps/calendar/apps/backend -# Expose port -EXPOSE 3014 +# Default port (overridden by PORT env var in docker-compose) +ENV PORT=3014 +EXPOSE ${PORT} -# Health check +# Health check using PORT env var HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD wget --no-verbose --tries=1 --spider http://localhost:3014/api/v1/health || exit 1 + CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT}/health || exit 1 # Run entrypoint script ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/apps/calendar/apps/web/Dockerfile b/apps/calendar/apps/web/Dockerfile index c1d3b1434..dc7554079 100644 --- a/apps/calendar/apps/web/Dockerfile +++ b/apps/calendar/apps/web/Dockerfile @@ -78,17 +78,16 @@ COPY --from=builder /app/apps/calendar/apps/web/node_modules ./node_modules COPY --from=builder /app/apps/calendar/apps/web/build ./build COPY --from=builder /app/apps/calendar/apps/web/package.json ./ -# Expose port -EXPOSE 5186 - # Set environment variables ENV NODE_ENV=production -ENV PORT=5186 +ENV PORT=5012 ENV HOST=0.0.0.0 -# Health check +EXPOSE ${PORT} + +# Health check using PORT env var HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD wget --no-verbose --tries=1 --spider http://localhost:5186/health || exit 1 + CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT}/health || exit 1 # Run the app CMD ["node", "build"] diff --git a/docker-compose.macmini.yml b/docker-compose.macmini.yml index 75d2196ba..3d31b49a5 100644 --- a/docker-compose.macmini.yml +++ b/docker-compose.macmini.yml @@ -347,6 +347,7 @@ services: MANA_CORE_AUTH_URL: http://mana-auth:3001 CORS_ORIGINS: https://calendar.mana.how,https://mana.how ADMIN_SERVICE_KEY: ${MANA_CORE_SERVICE_KEY} + ENCRYPTION_KEY: ${CALENDAR_ENCRYPTION_KEY:-} ports: - "3032:3032" healthcheck: