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