Dockerized DEV Environment with DevContainers | Multiple Containers | VSCode

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 16

  • @shaktigoyal6713
    @shaktigoyal6713 2 місяці тому +1

    I have been using DevContainer for a long time now.. this is really good video.. crisp and clear.. covering many scenarios .. Thank you for video !

    • @ChandraShettigar
      @ChandraShettigar  2 місяці тому

      Thanks for watching and for your kind words, Shakti. It's good to hear you're already familiar with DevContainer and found the video valuable.

  • @itrrmp
    @itrrmp Місяць тому +1

    What a great video. I just wish it was a php setup!

    • @ChandraShettigar
      @ChandraShettigar  Місяць тому

      Thanks for the feedback! Glad you enjoyed the video. It wasn't specifically about PHP, but the general concepts should still apply. I'm curious if this video inspired you to give a PHP DevContainer a try?

  • @aproperhooligan5950
    @aproperhooligan5950 4 місяці тому +1

    Really nice and concise content, Chandra. Thanks!

    • @ChandraShettigar
      @ChandraShettigar  4 місяці тому

      Glad you liked it! Thanks for watching and sharing your thoughts.

  • @EzequielTejada
    @EzequielTejada 6 місяців тому +1

    Great video!!! Also, I liked the way you setup multiple containers 👏👏👏

    • @ChandraShettigar
      @ChandraShettigar  6 місяців тому

      Glad you liked it!! Thanks for watching and sharing your thoughts.

  • @JorgeOrtiz-qn3rw
    @JorgeOrtiz-qn3rw 5 місяців тому +1

    Great tutorial! Btw, I have a question. What is the purpose of the command in the app service? The "tail -f /dev/null" command? Thanks

    • @ChandraShettigar
      @ChandraShettigar  5 місяців тому

      Thank you.
      The command "tail -f /dev/null" is a technique to keep a service container running indefinitely. I use this in DevContainer setup is to override the default CMD defined in Dockerfile. By default, I like the app run (in this case - the command is 'rails s -b 0.0.0.0') when used outside the DevContianer setup, but in the DevContainer I prefer it load the container without loading the application (rails) but we just need the the environment without everything installed.
      The command "tail -f /dev/null" essentially does nothing but wait indefinitely for new data to appear in /dev/null, which never happens.
      I hope this helps.

    • @JorgeOrtiz-qn3rw
      @JorgeOrtiz-qn3rw 5 місяців тому

      @@ChandraShettigar Is there a problem if I omit that command?

    • @ChandraShettigar
      @ChandraShettigar  5 місяців тому

      Not really, for the example code. But here are a couple of scenarios to test,
      The Dockerfile in the example has the CMD that runs the application server (rails s...). With that if you omit the "command" in docker-compose.yml, upon DevContainer Rebuild/Ropen, it should loan the environment just fine. But it already starts the application server (rails s ..). You should be able to hit localhost:3000/ and it should respond. Because I don't want it start the app server on loading the container environment, I set the command in docker-compose.yml, to basically do nothing.
      Another option, if we don't want the app server to start on loading the container environment, you could just change the CMD to either tail /dev/null or do something that is long running. That way, you can omit the "command" from docker-compose.yml
      And the "command" that tails /dev/null is omitted and CMD from Dockerfile is removed, DevContainer will fail to start as the container will exit as soon as it starts. It needs a command that runs idefinitely.

  • @maheshsharma-zq2uc
    @maheshsharma-zq2uc 4 місяці тому +1

    Can you help me in github codespace as i am using docker compose file to lauch postgres along with pgadmin but it is not opening in browser. Pgadmin is showing not reachable even port is also forwarded. Dont know why its not accessible from browser

    • @ChandraShettigar
      @ChandraShettigar  4 місяці тому

      I haven't really tested any devcontainer setup on github codespace but I can give pgadmin and postgres a try. Can you share the docker-compose example you're working on? Even better, if you have github repo that you can share

    • @maheshsharma-zq2uc
      @maheshsharma-zq2uc 4 місяці тому +1

      @@ChandraShettigar sure I will share it on tomorrow

    • @ChandraShettigar
      @ChandraShettigar  4 місяці тому

      @@maheshsharma-zq2uc - I was able test a quick setup on github codespaces. Let me now if this is kind of setup you were hoping to create on github codespaces - dev.to/shettigarc/easy-github-codespaces-setup-your-app-postgres-and-pgadmin-3b08