fix(docker): bake server path into entrypoint (ignore runtime APP_NAME) - #100
Merged
Merged
Conversation
All three services crash-looped with Cannot find module '/app/apps/vibestack-vibestack-azmdyg/server.js' Dokploy injects its own APP_NAME (the project name) into every container, and env_file overrides image ENV, so the prior CMD `sh -c 'exec node apps/$APP_NAME/server.js'` resolved $APP_NAME to the project name -> wrong path, identical failure across all apps. Fix: write the resolved path into /app/start.sh at BUILD time from the build ARG, and CMD it. Runtime env can no longer influence the path. Verified: image built with APP_NAME=web boots cleanly even when run with -e APP_NAME=vibestack-vibestack-azmdyg injected (Next ready, health serves). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Why
All three services crash-looped:
Cannot find module '/app/apps/vibestack-vibestack-azmdyg/server.js'Dokploy injects its own
APP_NAME(= the project name) into every container, andenv_fileoverrides imageENV. The previous CMDsh -c 'exec node apps/$APP_NAME/server.js'therefore read the platform'sAPP_NAME, not the build-time one → wrong path, same failure for web/marketing/admin.Fix
Resolve the path at build time: write
/app/start.shfrom the build ARG andCMD ["/app/start.sh"]. Runtime env can no longer affect it.Verified locally
Built the web image (
APP_NAME=web), ran it with-e APP_NAME=vibestack-vibestack-azmdyginjected (reproducing Dokploy). Container boots:✓ Ready,/api/healthserves (503 only because no DB attached). Without the fix this is the exact crash.🤖 Generated with Claude Code