FROM node:14.15.0-alpine
WORKDIR /usr/src/app
COPY package*.json ./
RUN CYPRESS_INSTALL_BINARY=0 npm i
COPY . ./
RUN npm run backend:build && npm run backend:serve
EXPOSE 8080
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?
It seems your Dockerfile is missing a CMD or 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:
CMD ["node","app.js"]
(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: