Screencast Build a Node App With Postgres and Docker Electives

  • Jon Friskics



  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 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.


  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 at Object.exports._errnoException (util.js:907:11) at exports._exceptionWithHostPort (util.js:930:20) at TCPConnectWrap.afterConnect net.js:1081:14


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

  23. jonohutchison said

    Hi all, thanks for a great course. I'm also having the same issue with getting a timeout error when the app attempts to connect to Postgres. I've definitely got the Postgres database up and running, and port 9000 is open when I port scan the Gateway IP. I've tried rebuilding both containers but no luck. Any help greatly appreciated!

  24. onncho said

    Great Session !! Tnx!

  25. Vadim Shvetsov said

    Thanks for a great course. Could you please share your iTerm theme and font, AJ?

  26. Michael Vervloet said

    is there a way to dynamically get the ip address from the db server inside the server.js file, I'm guessing it won't be the same on every machine? Or is it?

  27. flieger said

    Excellent video! I learned a lot!

    One thing I don't understand: Why do we use the bridge gateway address rather than the postgres container address?


  28. langtutheky said

    @flieger I have exactly the same question, and could not find an answer. Since both the node and postgres containers share the same bridge gateway address, it does not make any sense to use the gateway address rather than its own container address as a connection host.

  29. Faculty

    Stefan Nychka said

    Hi! I'm not sure why, but if you use the internal postgresql port (the internal node-db container's port), you can use the db's ip to connect directly as well. See for more on this

  30. David Tang said

    Great video guys!

  31. ramondo said

    Great video and good pace to get up to speed with Docker

  32. plexq said

    Seconding Pima, you stopped the container. When I start the container again, the files ARE there. What you are speaking is literally incorrect. If you wipe out the container, well, of course the files are gone with it. Credibility of the material is damaged by this. How do I trust what the rest of what you are saying is actually accurate? :/. Not good for a course that was paid for.

  33. plexq said

    Pretty sure your node app has a serious bug; rows will come back from PostgreSQL in database order, not in ID order. This means that the result of the query output could get assigned in the wrong order!! Also. Copy/Paste; shame on you. Teaching people bad habits from day one - please consider making it a delegate function instead. I know it's just a tutorial, but these are the tutorials where people learn their behaviours.

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