fly-apps / dockerfile-node

Dockerfile generator for Node.js
126 stars 5 forks source link

Generated Dockerfile for nuxtjs application point to a wrong entry point file by default #54

Closed benbjohnson closed 2 months ago

benbjohnson commented 2 months ago

Moving bug report from https://github.com/superfly/flyctl/issues/3404

Describe the bug In a nuxtjs application, the entry point file is not index.js but .output/server/index.mjs . With 0 change to configurations, by running fly launch; the generated Dockerfile has CMD [ "node", "index.js" ] instead of CMD [ "node", ".output/server/index.mjs" ] which craches the deployment

Operating system : windows 11 fly version : 0.2.25

ElvisAns commented 2 months ago

Replying to https://github.com/superfly/flyctl/issues/3404#issuecomment-2021341396 flyctl detected correctly that i am using nuxt, and i have nuxt config of course. I dont know how but after deployment i saw that the server was rebooting and later i checked the dockerfile that flyctl launch generated, it was pointing to index.js as entry file and i had to change that....

ElvisAns commented 2 months ago

Okay, looking at the Dockerfile template, i guess the cli did other changes to fit my project, for example it added PUPPETEER_EXECUTABLE_PATH in the dockerfile with no manual change from me, just running fly launch

rubys commented 2 months ago

Take a look around this project. As you can see, the fix for this issue was trivial. If you see other ways in which the dockerfile produced can do the right thing simply by looking at your source (and in particular, your package.json), let us know with issues or pull requests.