Screencast Build a Node App With Postgres and Docker Electives

  • Jon Friskics
  • 1902 views

Resources

Comments

  1. Jason Lampel said

    That iTerm font/theme is gorgeous. What is it?

  2. LoganGS said

    Very helpful video, thank you all!

    After AJ cloned the project, he updated the src/server.js file and connected the app to a Postgres container instance with a specified IP.

    Is this IP address okay to be committed to the project? Will the IP address be persistent for other developers who clone the project?

  3. Ray East said

    Hey guys, great video! And thanks for the new course! IMHO, the only thing missing from the video is how to run an environment that consists of multiple services (applicable here, too) through docker-compose.

  4. Fernando Lima said

    Thx. =)

  5. Délita Makanda said

    I have 1 error with server.js Running on http://localhost:8888 /usr/src/app/src/server.js:17 if (err) throw err; ^

    Error: connect ECONNREFUSED 172.17.0.1:9000 at Object.exports._errnoException (util.js:907:11) at exports._exceptionWithHostPort (util.js:930:20) at TCPConnectWrap.afterConnect net.js:1081:14 [nodemon] app crashed - waiting for file changes before starting... How I can resolve this ?

  6. Mike Flynn said

    I have been trying to figure out how you got iTerm2 to be so interesting. Can you please share how you did that with the class?

  7. Délita Makanda said

    okay sorry for the useless comment just put in comment the line and it worked. Thanks for the good tuto !

  8. Mike Flynn said

    Specifically the highlighting of ~/Desktop/... $

  9. Robert Smith said

    It's worth pointing out that to ensure the docker command that includes mapping your local folder to the docker volume works you may need to make that folder shared with docker. This can be done by clicking on the docker whale icon -> preferences -> File sharing and add the path to that directory there. This had me stumped for a while when the command docker run --name web-server -p 9999:80 --rm -v /path-to-tutorial/nginx/html/:/usr/share/nginx/html nginx:latest returned with the error: docker: Error response from daemon: Mounts denied: ker-for-mac/osxfs/#namespaces for more info

    Hope this helps some others.

  10. Faculty

    Jon Friskics said

    @Robert Smith - good call. The Docker App on OS X is automatically configured to allow volume mounting from anything in /Users, /Volumes, /tmp, and /private, and the Desktop folder is a subfolder of /Users on OS X so things "just worked". Sorry for any confusion this causes anyone else!

  11. Robert Smith said

    @Jon - that explains my issue then as I was not mounting from a subdirectory of any of those default directories. I really enjoyed this course. I've been recommended to checkout Docker compose as a next step. Do you think you will be doing a screencast covering that or more advanced Docker features? I'd really like to see how Docker can be used in deployment in AWS for example.

    Thanks!

  12. sabdiel said

    @Délita Makanda I ran into your same issue but commenting out the line did not make the trick for me.

    Running on http://localhost:8888 /usr/src/app/src/server.js:17 if (err) throw err; ^

    Error: connect ETIMEDOUT 172.17.0.1:9000 at Object.exports._errnoException (util.js:907:11) at exports._exceptionWithHostPort (util.js:930:20) at TCPConnectWrap.afterConnect net.js:1081:14

    Suggestions?

  13. sabdiel said

    I was not able to connect to the postgres db using the gateway ip but the specific container ip.. Is there any reason why this is not working for me?

  14. Dima Pilipenko said

    On 01:03:20 Jon says that "..we've stopped container, we've started again..". It's not correct at all in Docker terminology, because you created new one, removed previous one. If you would started container by docker start <container id> all data would be existed. My tip is: fix audio, because this moment can make the lost mindline for new learners :)

    Thanks for your work, and for Docker course. ps: your colleague looks like Myron from Fallout 2.

  15. Daniel Robert said

    @DélitaMakanda @sabdiel - I ran into the same issue. Commented out line 17 in src/server.js, as @DélitaMakanda stated, and it seems to work for me as well.

  16. sabdiel said

    Thanks @DanielRobert for the feedback, I tried again with not success, even though I would love to know why is not working for me i'm ok because it stills work with the container's ip

  17. sabdiel said

    Thanks @Jon Friskics, I really had fun and learned a lot with this screen-cast.

  18. Daniel Robert said

    @sabdiel - I actually didn't need to comment out line 17. I had accidentally copied over the completed file from the src code on GH. So, once I got further along in the course and created the postgres db, everything worked. The reason it was failing was because the node app was looking for the database and it didn't exist yet.

    One thing I did do was remove the :blahblah from line 9 in server.js, as it was not added in the video. ¯_(ツ)_/¯

    Hope that helps!

  19. Vladimir said

    Hi guys! Thanks for great video! But I've met some issue - after map my host folder to container, every change I make in my host files don't propagates to container. So I need to recreate container in order to see my changes. My env: Win10+VirtualBox. Later I found out what's the point: VirtualBox shared folders don't support inotify https://www.virtualbox.org/ticket/10660 Be aware!

  20. rsalgado said

    Thank you both for the screencast, it complements well the Try Docker course, and helps to put in practice some of the concepts from the course and provides valuable tips on how to solve certain problems. Great job.

  21. Rodrigo Encinas said

    While making your Dockerfile, what's the difference between RUN npm and CMD ["npm"]?

  22. Adam Griffin said

    Glad to see that I'm not the only one that accidentally types "dcoker" every time on the first try :D

About This Screencast

In this episode, we'll apply what you learned in the Try Docker course and show you some real-world development scenarios for using Docker. We will start by working in a container running the Nginx web server, and then build a two-container application that powers a simple Node app with Postgres database.

You need to be an enrolled student in order to view this video and subscribe.

Enroll Now