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
  • НаукаНаука

Комментарии • 75

  • @BoolFalse
    @BoolFalse Год назад +8

    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

  • @hazartilirot1014
    @hazartilirot1014 2 года назад +1

    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.

  • @ahmadsalih6844
    @ahmadsalih6844 3 года назад +5

    GREAT effort, I'm looking forward to watching more advanced tutorials from you.
    *suggestions*
    - deployments
    - handling ORM between server & db containers.

  • @cryptus_neoxys
    @cryptus_neoxys 3 года назад +10

    WoW, hope to see coming videos along with bits of DevOps too 🤩🤩🤩

  • @tomaszstec5672
    @tomaszstec5672 3 года назад +2

    Another stick-to-my-mind-way-of-explaining-things tutorial. Nice job and huge thanks!!!

    • @Classsed
      @Classsed  3 года назад

      You're welcome mate :)

  • @fellainthewagon7166
    @fellainthewagon7166 3 года назад

    great!
    if you need delete container use flag -f which is force: docker rm -f

  • @codewithmorkeh
    @codewithmorkeh Год назад

    You have given me a career. Thanks for your great effort to humanity.

  • @johnpirog
    @johnpirog 2 года назад +2

    Thanks for this video, it is fantastic. It really helped me figure out how to do this.

  • @babayaga5266
    @babayaga5266 10 месяцев назад

    Awesome tutorial. Just what i was looking for days. Thanks alot

  • @zemaumm
    @zemaumm 3 года назад +4

    LITERALLY what I was looking for, thank you !!!

    • @Classsed
      @Classsed  3 года назад +1

      Awesome, you're welcome :)

  • @ridl27
    @ridl27 3 года назад

    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

  • @YashPatil-sy9sk
    @YashPatil-sy9sk 7 месяцев назад

    Amazing tutorial. Kudos to you!!!

  • @MrZiyak99
    @MrZiyak99 3 года назад +3

    Nice! A video on Kubernetes would be a perfect compliment to this video.

    • @aksharpatel17
      @aksharpatel17 3 года назад

      @Bobby Leo what if my friend doesn't use instagram does it works for snapchat?

  • @yulianagonzalez7452
    @yulianagonzalez7452 Год назад

    Thanks so much for this!

  • @indiemusicradio
    @indiemusicradio 2 месяца назад

    very nice tutorial. solved a problem I had - setting the host to the docker-compose name

  • @flaviorocha9804
    @flaviorocha9804 Год назад

    Very good video. Congratulations!

  • @usamnetabdu9506
    @usamnetabdu9506 3 года назад +1

    Nice Tutorial! I'm loving it

  • @juliasetiawan9784
    @juliasetiawan9784 3 года назад

    This is what i've been waitin fo

  • @herbertk9266
    @herbertk9266 3 года назад

    Awesome as always thanks

  • @lukaskesch
    @lukaskesch Год назад

    Great job learned a lot!

  • @coliwong6018
    @coliwong6018 3 года назад

    Great video and thanks for sharing

  • @why1978
    @why1978 2 года назад

    Excellent tutorial ! kudos

  • @jarrayamehdi6566
    @jarrayamehdi6566 2 года назад

    Great tutorial !

  • @henriquetegel3390
    @henriquetegel3390 2 года назад

    Nice work!

  • @andreagongora1955
    @andreagongora1955 3 года назад

    Amazing and useful video !! Thakss

  • @lifeisbeautifu1
    @lifeisbeautifu1 Год назад

    Thank you so much🥰

  • @bersano5161
    @bersano5161 Год назад

    fookin legend!

  • @deviq1327
    @deviq1327 3 года назад

    Nice explanation thnx :)

  • @anujan7798
    @anujan7798 3 года назад

    dope 🔥🔥🔥

  • @aigamemakerThai
    @aigamemakerThai 2 года назад

    Supurb, great tutorials

  • @subhadipdutta1999
    @subhadipdutta1999 3 года назад

    awsome brother, love from india 👍👍👍

  • @AsishSharma-gi8tb
    @AsishSharma-gi8tb Год назад

    Thanks

  • @adnanjlassi5332
    @adnanjlassi5332 3 года назад

    Thank you :)

  • @salemouail627
    @salemouail627 3 года назад +1

    Thanks so much

  • @n1ls0n
    @n1ls0n 2 года назад

    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!

  • @user-sv1ze9gk3b
    @user-sv1ze9gk3b 2 года назад

    cool !

  • @yomziiblack3776
    @yomziiblack3776 3 года назад +2

    Please try making a video on CI CD with mern and docker deployment ..
    Please if your free it's a humble request

  • @Sam-kr5ix
    @Sam-kr5ix 2 года назад

    Is that great work ?
    Yes it is ! :)

  • @syz3981
    @syz3981 3 года назад +1

    Can i develop my node app inside the container ? Like will the nodemon work when i re-save something ?

    • @Classsed
      @Classsed  3 года назад

      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

  • @sairaj5660
    @sairaj5660 3 года назад

    ❤️

  • @user-rh6qw5xh8j
    @user-rh6qw5xh8j Год назад

    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 ?

  • @all-in-all7862
    @all-in-all7862 3 года назад

    Amazing!! How to create React and Node js Docker in combines.

    • @Classsed
      @Classsed  3 года назад +1

      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

    • @rahulsriram6295
      @rahulsriram6295 3 года назад

      @@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?

  • @megatomek2000
    @megatomek2000 3 года назад

    👌👌👌👌👌👌

  • @usmanmughal5916
    @usmanmughal5916 3 года назад +2

    Will you have a video on session based auth with redis,express?

    • @Classsed
      @Classsed  3 года назад

      This takes like two minutes to set up, dont think it deserves a whole video :D

    • @h.kubilay6160
      @h.kubilay6160 3 года назад

      @@Classsed do you think session based is overkill or better?

    • @Classsed
      @Classsed  3 года назад

      it's not overkill, it's a superior method, it gives you more functionality and user data

    • @usmanmughal5916
      @usmanmughal5916 3 года назад

      @@Classsed It takes 2 minutes for you :) and if its really two minutes then it would not hurt to make a video :P

    • @Classsed
      @Classsed  3 года назад +1

      fair enough, I'll add it to my list but no promises :P

  • @progressnwimuelekara2167
    @progressnwimuelekara2167 Год назад

    Has anyone ever told you you sound like Kevin DeBruyne, the Manchester City football player. :D

  • @rachiid0074
    @rachiid0074 2 года назад

    What is your Vscode theme? 🤩

  • @juamineta4789
    @juamineta4789 2 года назад

    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.

  • @h.kubilay6160
    @h.kubilay6160 3 года назад +1

    brooooo thank you. can you do a tutorial for full authentication with refresh tokens and forget email? that would be nice. :D

    • @Classsed
      @Classsed  3 года назад +1

      I will cover refresh tokens soon

    • @avinashkumarsingh8492
      @avinashkumarsingh8492 3 года назад +1

      @@Classsed I also need it. Please do it ASAP

    • @Gos2
      @Gos2 2 года назад

      Please do it , i need it as well!

  • @neilguylindberg6672
    @neilguylindberg6672 3 года назад

    Avoid cleaning up stopped containers inbetween running with dash dash rm --rm, i.e. docker run -d --name mycontainer --rm imagename

  • @romimaximus
    @romimaximus 3 года назад

    This is soooo confusing.!!! lol.... i gonna have to watch this a few 20 times...lol..😂😂

  • @javhm1611
    @javhm1611 Год назад

    ❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤

  • @adante407
    @adante407 3 года назад

    If you're on Windows 10 home? Forget Docker.

    • @Classsed
      @Classsed  3 года назад

      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/

  • @wuzahns5302
    @wuzahns5302 2 года назад

    40 damn minutes but it could be 5