When I run the prod docker, i get "failed to compute checksum, usr/src/app/dist not found". also, why do you not put volumes in the production docker compose?
I'm watching this movie late but I have a question, or rather doubt. In the docker compose file, you map the local folder with the code to the app folder in the container: volumes: - .:/usr/src/app In turn, in Dockerfile you copy the same directory: WORKDIR /usr/src/app COPY . . Isn't this an error? the /usr/src/app directory is mapped to our local application directory on the host.
Could you also share the best practice how to 1) install and use postgres db in a container for dev environment and 2) store and use Environmental variables for dev and prod container?
I had to change my "dev" script to be `npx ts-node-dev src/server.ts`. Otherwise when I run the `docker compose` command for the dev environment, the running container gets an error saying `sh: ts-node-dev: not found`. Why would this happen?
I think it's because ts-node-dev binary hasn't been added to the container's path so when executed like this, the ts-node-dev is correctly found to be not a viable command that can be ran on your container. However, as you have installed ts-node-dev and is in your node_modules folder, npx can route the command into the binary located in node_modules folder and run the command perfectly as you have identified
Great teaching! You take the time to explain the concepts really well like a teacher with examples and anticipating our potential mistakes. I got stuck on a compose volumes error for a long time, and all the videos I had seen prior to yours had not explained the concepts as thoroughly with examples as you did.
I spent like a week building my ultimate docker + typescript from many sources and trust me when I say that you have made this way easier than anyone I have seen. I really like this tutorial since you didnt shy away from explaining simple details that everyone just ignores. I'll be using this setup in every project from now. Thanks a lot man! You've got a sub :)
This was an amazing video about TS in Docker, holy crap. You summed it up great at the end, this gives viewers a great foundation to build off of, and more importantly: it actually works. Amazing tutorial.
Nide tutorial. But what should we if we want to let the dev and prod images run at the same time. Now when each one is built, the other one will be killed.
Thanks for this video and for describing why you did things in the way that you did. It changed my perspective on dockerizing web apps as a whole. Previously I had done things at "run-time" so I'd use volumes and then use ENTRYPOINT or CMD to do the installing/building, but this tutorial taught how it is possible to do it all inside the image efficiently.
not working... my composed container is always exiting... I faced the same issue when doing your react container... I'm also unable to find any help on other sources. The logs says configuration file not found. I've tried stack overflow solutions still no help
the error went away after I changed docker-compose.dev.yml to docker-compose.yml, but now npm in the container is misbehaving and is not able to find package.json. This is getting crazy !
strangely though docker-compose.prod.yml did work... maybe docker-compose wants you to have atleast one docker-compose.yml file and not just .dev or .prod... very strange
Awesome as always. Please do some microservices in nodejs
Dude, I really enjoy your content. Your way of teaching resonates with me and makes learning exciting again.
Thanks
When I run the prod docker, i get "failed to compute checksum, usr/src/app/dist not found".
also, why do you not put volumes in the production docker compose?
I'm watching this movie late but I have a question, or rather doubt.
In the docker compose file, you map the local folder with the code to the app folder in the container:
volumes:
- .:/usr/src/app
In turn, in Dockerfile you copy the same directory:
WORKDIR /usr/src/app
COPY . .
Isn't this an error? the /usr/src/app directory is mapped to our local application directory on the host.
Could you also share the best practice how to 1) install and use postgres db in a container for dev environment and 2) store and use Environmental variables for dev and prod container?
One of the greatest tutorials I saw in a long time, thanks.
I must admin - really, really good explanation of dockerizing such apps. Keep up that way!
I had to change my "dev" script to be `npx ts-node-dev src/server.ts`. Otherwise when I run the `docker compose` command for the dev environment, the running container gets an error saying `sh: ts-node-dev: not found`. Why would this happen?
I think it's because ts-node-dev binary hasn't been added to the container's path so when executed like this, the ts-node-dev is correctly found to be not a viable command that can be ran on your container.
However, as you have installed ts-node-dev and is in your node_modules folder, npx can route the command into the binary located in node_modules folder and run the command perfectly as you have identified
Thank you, i will implement. New sub !!!
Great teaching! You take the time to explain the concepts really well like a teacher with examples and anticipating our potential mistakes. I got stuck on a compose volumes error for a long time, and all the videos I had seen prior to yours had not explained the concepts as thoroughly with examples as you did.
i do and successfully thank you
I spent like a week building my ultimate docker + typescript from many sources and trust me when I say that you have made this way easier than anyone I have seen. I really like this tutorial since you didnt shy away from explaining simple details that everyone just ignores. I'll be using this setup in every project from now. Thanks a lot man! You've got a sub :)
Your tutorials are the best!
Great stuff!!! Nice to see content coming again!!!
like for this content!
This was great thanks
This was an amazing video about TS in Docker, holy crap. You summed it up great at the end, this gives viewers a great foundation to build off of, and more importantly: it actually works. Amazing tutorial.
Great Video! What happens when npm install while docker is running on dev mode? Does the image automatically install new packages?
Nide tutorial. But what should we if we want to let the dev and prod images run at the same time. Now when each one is built, the other one will be killed.
I learn a lot from you thanks
Thanks for this video and for describing why you did things in the way that you did. It changed my perspective on dockerizing web apps as a whole. Previously I had done things at "run-time" so I'd use volumes and then use ENTRYPOINT or CMD to do the installing/building, but this tutorial taught how it is possible to do it all inside the image efficiently.
Simplesmente a melhor introdução para quem quer começar no mundo docker... Obrigado !!!
Top notch quality, as always. Thanks Sanjeev
This is a really useful walk through. Thank You
This video is great. Good explanation, love the content 👍
Amazing tutorial, thanks for sharing!
this deserves more than 7.9k views. great teaching!
Thanks!!
nice content
How to configure debugging in the docker ?
Thank you!!!
massive thank you for this video
Where are all docker container files?
Really helpful, thanks!
Does debugging work?
not working... my composed container is always exiting... I faced the same issue when doing your react container... I'm also unable to find any help on other sources. The logs says configuration file not found. I've tried stack overflow solutions still no help
the error went away after I changed docker-compose.dev.yml to docker-compose.yml, but now npm in the container is misbehaving and is not able to find package.json. This is getting crazy !
npm error got solved after I switched from dockercompose v1 to docker compose v2
strangely though docker-compose.prod.yml did work... maybe docker-compose wants you to have atleast one docker-compose.yml file
and not just .dev or .prod... very strange
Thank you!!
Good one👍👍👍
That was a very useful and insightful tutorial. Great job