Skip to content

Fix web container exiting immediately in production compose - #93

Closed
vaibhavmashal wants to merge 2 commits into
PostHog:mainfrom
vaibhavmashal:main
Closed

Fix web container exiting immediately in production compose#93
vaibhavmashal wants to merge 2 commits into
PostHog:mainfrom
vaibhavmashal:main

Conversation

@vaibhavmashal

Copy link
Copy Markdown

Fixes #45. Fixes #80. Fixes #52.

The rontend/Dockerfile previously just echoed a message and exited, causing the web container to stop and caddy to fail to reverse proxy to it in docker-compose.yml. This updates the Dockerfile to use the \serve\ package to host the static build files on port 3000, so that the container stays alive and correctly serves the frontend.

Copilot AI lite review requested due to automatic review settings August 23, 2026 15:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the production web container image so it runs a real static file server instead of exiting immediately, allowing Caddy to successfully reverse-proxy to the frontend.

Changes:

  • Switches the frontend image base from alpine to node:20-alpine.
  • Installs serve and runs it to host the static frontend on port 3000.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/Dockerfile Outdated
Comment on lines +5 to +8
RUN npm install -g serve
COPY build/ build/

CMD ["echo", "Serve the files from /frontend/build, don't run this container directly"] No newline at end of file
CMD ["serve", "-s", "build", "-l", "3000"] No newline at end of file
@vaibhavmashal

Copy link
Copy Markdown
Author

Updated \ rontend/Dockerfile\ to use a multi-stage build (\pnpm build\ in the builder stage) and pinned \serve\ to @14.2.4\ so \docker compose build web\ builds deterministically without requiring a manual host-side build step.

@vaibhavmashal vaibhavmashal closed this by deleting the head repository Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants