Fix web container exiting immediately in production compose - #93
Closed
vaibhavmashal wants to merge 2 commits into
Closed
Fix web container exiting immediately in production compose#93vaibhavmashal wants to merge 2 commits into
vaibhavmashal wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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
alpinetonode:20-alpine. - Installs
serveand 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 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 |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.