Issue when deploying node app using docker
I'm having issues when I'm trying to deploy a node app with docker, when I build and run the image locally it runs fine but on railway it shows me the build the built node file not found. Also, this is something that is fairly recent and my docker config file hasn't changed so not sure why this might be happening. Help appreciated, thanks!
Solution:Jump to solution
ah thanks, just found out the cause of the issue. It was a change that was pushed yesterday that resulted in dist folder not being generated in CI builds which is why it worked locally but not when it was deployed via CI.
19 Replies
Project ID:
033f39f1-9797-405f-88f8-343ca4ac4254
033f39f1-9797-405f-88f8-343ca4ac4254
For some context, the build succeeds but when the cmd command is ran is when the error is thrown and the healthcheck fails, causing the deployment to fail.
Please send the dockerfile and the error that is thrown
Hey, thanks for the quick reply! Is there a private portal that I can send it through?
nvm, sorry I just realized I don't have any sensitive info in the docker file so here it goes
And here are the logs:
just realized I don't have any sensitive info in the docker filei would sure hope so 😆 can you try removing the
WORKDIR /app/apps/api
linesure, I'll try it and be back in a bit! appreciate the quick responses!
okay, so it just finished a deployment but I'm still getting the same error. I updated the dockerfile to remove
WORKDIR /app/apps/api
and updated the CMD command to run node apps/api/dist/index.js
but I'm still seeing the same error.are you sure the
dist
folder is going to end up in /app/apps/api
?mhm, yeah I checked the built image locally and the index.js file to be run is inside the
/app/apps/api/dist
directory.chuck in some ls commands and see what that prints on railway?
I'm sorry but I don't know how to do that in railway? is there an article i can follow to see how to do so?
RUN ls -l
ah, gotcha in the docker image, right?
Dockerfile
yes, got it
thanks! will try and get back with what shows up
sounds good