I have a docker file that looks like this:
COPY package*.json ./
RUN CYPRESS_INSTALL_BINARY=0 npm i
COPY . ./
RUN npm run backend:build && npm run backend:serve
When I deploy it using
fly --app construkt deploy it runs fine, then echoes the message that comes from my framework, about serving at 0.0.0.0:8080, and then nothing. It hangs like that. What can I do?
Thanks in advance!
It seems your
Dockerfile is missing a
ENTRYPOINT. All the ones I’ve seen with node need one of those.
If that’s it, it may be as simple as adding this as the last line:
(editing “app.js” of course to be your one e.g server .js or src/app.js, or index.js or whatever it is)
You can double-check your app is running and serving requests by adding a http healthcheck to your
fly.toml. That will fail the deploy if the app is not serving requests, which can be handy. Take a look at:
Hey hey, that was it! My Dockerfile was missing
CMD. I run the app via, well,
RUN command instead, hence the error. Thanks for a quick help, Greg!
run command is likely just hanging up the builder. It would be best to remove that from your Dockerfile if you haven’t already!