Docker Tutorial (+ Node & Postgres setup)
HTML-код
- Опубликовано: 25 фев 2021
- ❤️ Become a Patron and help the channel grow
/ classsed
⌨️ Node app
github.com/hidjou/classsed-do...
⌨️ Complete Source Code
github.com/hidjou/classsed-do...
🐦 Follow on Twitter
/ classsed
👨👨👦 Join the Discord Server
/ discord
🌍 Sign up for exclusive content
classsed.com Наука
Thanks for this lesson.. nice work !! Commands timestamps:
5:17 docker
6:20 docker pull node
6:30 docker images
7:10 docker ps -a
7:23 docker container ls -a
7:30 docker run node
7:55 docker run -it node
10:15 # create a Dockerfile
12:15 docker build . --tag node-server
13:10 docker run --name node-server-container node-server
14:30 docker stop node-server-container
14:35 docker rm node-server-container
15:33 docker run --name node-server-container -p 5000:5000 -d node-server
15:50 # code changes
16:27 docker build . --tag node-server
17:20 docker stop node-server-container -t 0
17:40 # docker stop
17:45 docker rm node-server-container
17:50 docker rmi
18:25 docker run --name node-server-container -p 5000:5000 -d node-server
18:55 # Dockerfile changes
19:12 # create .dockerignore
19:32 docker build . -t node-server
19:55 docker stop node-server-container -t 0
20:02 docker rm node-server-container
20:07 docker run --name node-server-container -p 5000:5000 -d node-server
21:00 docker exec -it node-server-container bash
21:20 docker exec node-server-container npm list
20:38 git clone git@github.com:hidjou/classsed-docker-tutorial.git
24:40 docker run --name postgres-docker -e POSTGRES_PASSWORD=postgres -d -p 4321:5432 postgres
25:40 psql -h localhost -p 4321 -U postgres
26:28 docker exec -it postgres-docker psql -U postgres
30:55 # create docker-compose.yml
31:10 # stop containers
31:14 # remove containers
31:35 # remove images
31:50 docker-compose up -d
32:50 # code changes
33:18 docker-compose down
34:50 docker-compose up -d --build
34:58 docker exec npm run migrate
35:27 docker exec npm run seed
35:03 psql -d docker -p 4321 -U postgres
36:20 docker-compose down
37:25 # setup volumes to docker-compose.yml
38:14 docker-compose up -d --build
38:38 docker exec npm run migrate
38:41 docker exec npm run seed
38:59 docker-compose down
39:13 docker volume ls
39:30 docker-compose up -d --build
Wow, I'd say it's a great reminder. I've watched a course 5 hours long created by Mosh though I 've forgotten most of commands. Your video gave me a boost. :D Thanks.
GREAT effort, I'm looking forward to watching more advanced tutorials from you.
*suggestions*
- deployments
- handling ORM between server & db containers.
WoW, hope to see coming videos along with bits of DevOps too 🤩🤩🤩
You will ;)
Another stick-to-my-mind-way-of-explaining-things tutorial. Nice job and huge thanks!!!
You're welcome mate :)
great!
if you need delete container use flag -f which is force: docker rm -f
You have given me a career. Thanks for your great effort to humanity.
Thanks for this video, it is fantastic. It really helped me figure out how to do this.
Awesome tutorial. Just what i was looking for days. Thanks alot
LITERALLY what I was looking for, thank you !!!
Awesome, you're welcome :)
ty for such a useful tutorials! it would be great to see in the future docker+ci/cd and some other funny devops things tutorial :D
Amazing tutorial. Kudos to you!!!
Nice! A video on Kubernetes would be a perfect compliment to this video.
@Bobby Leo what if my friend doesn't use instagram does it works for snapchat?
Thanks so much for this!
very nice tutorial. solved a problem I had - setting the host to the docker-compose name
Very good video. Congratulations!
Nice Tutorial! I'm loving it
Thanks :))
This is what i've been waitin fo
Awesome as always thanks
Great job learned a lot!
Great video and thanks for sharing
Excellent tutorial ! kudos
Great tutorial !
Nice work!
Amazing and useful video !! Thakss
Thank you so much🥰
fookin legend!
Nice explanation thnx :)
dope 🔥🔥🔥
Supurb, great tutorials
awsome brother, love from india 👍👍👍
Thanks
Thank you :)
Thanks so much
no problem :D
Thank you.
The changes de the file.db in host to the name of database in docker and delete port to use default save me!
cool !
Please try making a video on CI CD with mern and docker deployment ..
Please if your free it's a humble request
Is that great work ?
Yes it is ! :)
Can i develop my node app inside the container ? Like will the nodemon work when i re-save something ?
Yes you can, you just need to set up a bind mount from your machine and it will have the code from there and be up to date with yours
❤️
i've 2 scripts "dev" : "nodemon server.ts" and "start" " : "node dist/server.js" So which script do i've to put in the CMD option in Dockerfile ?
Amazing!! How to create React and Node js Docker in combines.
You just add one more container with a React app, and for production you add another one with nginx and configure it to reverse proxy requests for the server and the client containers
@@Classsed Can't we serve the 'build/index.html' file of react from node or express in production and use a single container? Should we for sure use Nginx? What'd you prefer?
👌👌👌👌👌👌
Will you have a video on session based auth with redis,express?
This takes like two minutes to set up, dont think it deserves a whole video :D
@@Classsed do you think session based is overkill or better?
it's not overkill, it's a superior method, it gives you more functionality and user data
@@Classsed It takes 2 minutes for you :) and if its really two minutes then it would not hurt to make a video :P
fair enough, I'll add it to my list but no promises :P
Has anyone ever told you you sound like Kevin DeBruyne, the Manchester City football player. :D
What is your Vscode theme? 🤩
Monokai Flow
No matter what I do, I cannot get around one error after I docker-compose and build the project... KnexTimeoutError: Timeout acquiring a connection. The pool is probably full. etc. etc.
Are you familiar with this error or know where it might be coming from? I double and triple checked, all my versions are exactly the same as yours, my connection properties the same, everything identical. It's driving me pretty crazy, tbh.
brooooo thank you. can you do a tutorial for full authentication with refresh tokens and forget email? that would be nice. :D
I will cover refresh tokens soon
@@Classsed I also need it. Please do it ASAP
Please do it , i need it as well!
Avoid cleaning up stopped containers inbetween running with dash dash rm --rm, i.e. docker run -d --name mycontainer --rm imagename
This is soooo confusing.!!! lol.... i gonna have to watch this a few 20 times...lol..😂😂
❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤
If you're on Windows 10 home? Forget Docker.
You can get docker on Windows 10 Home too, just enable WSL 2 which should be way easier to do now
docs.docker.com/docker-for-windows/install-windows-home/
40 damn minutes but it could be 5