Skip to content

Conversation

borja-rivera
Copy link

@borja-rivera borja-rivera commented Jul 16, 2025

This pull request updates the Dockerfile to use a distroless image for the production environment, simplifying the setup and improving security. The changes also adjust permissions and environment configurations to align with the new image.

Dockerfile updates for production:

  • Switched the base image for the production environment to gcr.io/distroless/nodejs18:nonroot, replacing the previous base image (node:18-alpine). This enhances security by minimizing the attack surface of the container.
  • Removed the creation of nodejs and nextjs system users and groups, as the distroless image operates without a shell or user management.
  • Simplified file copying by removing chown commands, as the distroless image does not require explicit ownership changes.

Environment and runtime configuration:

  • Added the CADENCE_WEB_PORT environment variable with a default value of 8088 and exposed port 8088 for the application.
  • Updated the CMD instruction to directly execute server.js, removing the shell-based command setup.

Testing

These changes have been tested on a staging cluster and the application works correctly with the new setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants