fly-apps / hello-fly

7 stars 8 forks source link

fix: ensure Dockerfile matches happy path configuration #6

Closed knksmith57 closed 8 months ago

knksmith57 commented 9 months ago

Although the "Deploy via Dockerfile" quickstart docs suggest fly will default to :8080 and will automatically use an EXPOSEd port if set, the observed behavior is that :3000 is always used instead.

Update Dockerfile to use :3000 and set the $PORT environment variable to ensure the application listens on the configured port.

Resolves #5

knksmith57 commented 9 months ago

/cc @lubien for review

Apologies, I can't find a team to mention instead so am pinging you directly 🙏

rubys commented 9 months ago

I'd rather make more happy paths. :-)

knksmith57 commented 9 months ago

I'd rather make more happy paths. :-)

Sounds good to me! I think you'll still want to pull the ENV instruction in from this PR to ensure the environment-configured $PORT is respected by the Node.js application.

Would you like me to update this PR to hold the existing port 8080 configuration and just introduce the ENV instruction instead?

rubys commented 9 months ago

Note: my pull request will parse for EXPOSE followed by a number. It will not attempt to evaluate an expression.

P.S. I'll leave it up to @lubien to decide how to proceed with this pull request. I've been recommending https://github.com/fly-apps/node-demo as a replacement. See https://fly.io/javascript-journal/vanilla-candy-sprinkles/ and https://fly.io/javascript-journal/ciabatta/ for more details.