Modern Python Projects Transcripts
Chapter: Deployment
Lecture: Free Docker playground

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Before we move on with this lesson, I had to make one change to the docker file. I have changed the part that were binding from 80 to Port 8000.
0:11 So in the Expose, we are exposing port 8000 and here we are also binding port 8000. So if you're following this on your computer,
0:21 make sure that you change port in those two places and then rebuild, retag and republish your image. So, basically,
0:31 run Docker Build, Docker Tag and Docker Push. I had to do this because since we are using a non route to user,
0:42 there are some problems with using ports that are lower than 1000.
0:46 So, instead of adding some additional comments to our docker file and making it more complicated the easiest way is to just use a high port.
0:54 Now let's talk about Docker Playground, before we move on to use a paid docker hosting I want to show you a website called Play With docker.
1:04 This is a playground for Docker where you can get a virtual machine for four hours and you can set up your docker images there.
1:12 It's very simple, but the most important thing is that it's free. So, let's get started. Play with Docker. Yeah, Not here. Yep.
1:26 Or you can directly go to the url labs.play-with-docker.com again. You will have to log in with your docker user name and password.
1:35 You will be redirected, and when you log in, you will get the start button. So once we click start, we can see this new interface.
1:43 So here we have the clock that is counting down for four hours, after four hours, everything that we have here will be gone.
1:52 So, Docker Playground, it's not a place where you can build like a persistent docker application. But if, for example,
2:00 you have problems installing docker on your local computer, this is a perfect place to go.
2:05 Also, when you want to practice using Docker outside of your local computer, you can use it. So let's add a new instance,
2:15 and this will create a small virtual machine for us. And here we have to run the same command that we were running on our local
2:22 computer. But this time we'll be using the image from the docker hub. So, keep in mind that this time we're exposing port 8000.
2:42 And since docker can't use the upptimer website image locally, it's downloading it from the docker hub.
2:50 Once this is done and everything seems to be working fine, we can click this button to open port 8000 and here we can see our
2:59 uptimer great. So even though we have a terrible url here, we actually have our uptimer somewhere on the Web,
3:08 not on our local computer. And all we had to do was to run this one single command. So, as you can see, once you have the docker image ready,
3:18 deploying it, it's much, much easier. Let's test it to make sure it's still working. Cool its working. So that's the URL that you can actually take and
3:36 send to someone. And if they are fast enough and your virtual machine doesn't disappear
3:41 after four hours, they will be able to see your up timer website up and running. How cool is that?
3:47 So, next let me show you how to deploy Docker image to some more production ready setting.


Talk Python's Mastodon Michael Kennedy's Mastodon