As we all know Docker is not just another buzzword, but one of the best containerization tool for software engineers. With the ability to ship any ...
For further actions, you may consider blocking this person and/or reporting abuse
I don't know why this is? , I followed the instructions on the tutorial, but I tried it, and it still didn't solve it!
You might be missing some build dependencies using the alpine version, you can use this instead;
Sorry, I did not post the complete configuration. I tried it and found that it was a problem with WORKDIR. It was normal when I ran it for the first time. This problem occurred the second time docker-compose up. is normal. I am trying to find out why.
" Error: Cannot find module '/app/dist/main.js" it was looking main.js at "/app/dist/main.js" instead of "/app/bd-url-query/dist/main.js"
Just take a look at what you have in your directory, add the ls command i.e "RUN ls -l" before "CMD....." line in your Dockerfile and inspect the files you have there
Nice post!
Just a small comment - I'm fairly certain that it's not necessary to do it in two steps by using first the full node image and then node-alpine. I got it working with just 1 step using node-alpine for everything:
FROM node:10-alpine
WORKDIR /app
COPY ${PWD}/package.json ./
RUN yarn
COPY . .
RUN yarn build
EXPOSE 5000
CMD ["sh", "-c", "yarn typeorm migration:run && yarn start:prod"]
Very true, although they might be scenarios where your dependencies rely on native builds, and that might require you to install build tools like node-gpy (which is written in python [meaning also need to install python] ), make, gcc, g++ which might not exists on alpine version,
Although you can still get away with it by installing build tools via apk in Dockerfile
This man...thanks for the article... this is Goodluck
Mahnn how u doing👍
Very good man and you?
Thanks for the post! it was a lot of help.
thanks man
Well explained, nice article.
Thanks a lot for sharing!!! :)
Good post. Thanks
Brilliant! Thank you!!
Hi Buddy.
This post is really good. It fixed my issue.
Thanks mate.
I was looking for a quick Dockerfile to test FluxCD with a simple NestJS hello world. Thanks for the snippet!
I have two apps:admin and agent and they are on 3000 and 3001 port.
npm run build agent
npm run build admin needs to be done .. how should I proceed?