|
1 | 1 | ## 2.0 Webapps with Docker
|
2 |
| -Great! So you have now looked at `docker run`, played with a docker container and also got a hang of some terminology. Armed with all this knowledge, you are now ready to get to the real-stuff i.e. deploying web applications with Docker. |
| 2 | +Great! So you have now looked at `docker run`, played with a docker container and also got the hang of some terminology. Armed with all this knowledge, you are now ready to get to the real-stuff i.e. deploying web applications with Docker. |
3 | 3 |
|
4 | 4 | ### 2.1 Static Sites
|
5 |
| -_Code for this section is in this repo in the [static-site directory](https://github.com/docker/labs/tree/master/beginner/static-site)_ |
6 |
| -Let's start by taking baby-steps. The first thing we're going to look at is how you can run a dead-simple static website. You're going to pull a docker image from the docker hub, run the container and see how easy it so to set up a webserver. |
| 5 | +>**Note:** Code for this section is in this repo in the [static-site directory](https://github.com/docker/labs/tree/master/beginner/static-site). |
| 6 | +
|
| 7 | +Let's start by taking baby-steps. First, we'll use Docker to run a dead-simple static website. You're going to pull a Docker image from the Docker Hub, run the container and see how easy it is to set up a web server. |
7 | 8 |
|
8 | 9 | The image that you are going to use is a single-page website that was already created for this demo and is available on the Docker Hub as [`seqvence/static-site`](https://hub.docker.com/r/seqvence/static-site/). You can download and run the image directly in one go using `docker run`.
|
9 | 10 |
|
10 | 11 | ```
|
11 | 12 | $ docker run seqvence/static-site
|
12 | 13 | ```
|
13 |
| -Since the image doesn't exist on your Docker host, the Docker daemon will first fetch the image from the registry and then run the image. |
14 |
| -Okay, now that the server is running, do you see the website? What port is it running on? And more importantly, how do you access the container directly from our host machine? |
| 14 | +Since the image doesn't exist on your Docker host, the Docker daemon first fetches the image from the registry and then runs the image. |
| 15 | + |
| 16 | +* Okay, now that the server is running, do you see the website? |
| 17 | +* What port is it running on? |
| 18 | +* And more importantly, how do you access the container directly from our host machine? |
15 | 19 |
|
16 |
| -In this case, the client didn't tell the Docker Engine to publish any of the ports so you need to re-run the `docker run` command. We'll take the oportunity to publish ports and pass your name to the container to customize the message displayed. While we are at it, you should also find a way so that our terminal is not attached to the running container. So that you can happily close your terminal and keep the container running. This is called the **detached** mode. |
| 20 | +In this case, the client didn't tell the Docker Engine to publish any of the ports, so you need to re-run the `docker run` command. We'll take the oportunity to publish ports and pass your name to the container to customize the message displayed. While we are at it, you should also find a way so that our terminal is not attached to the running container. So that you can happily close your terminal and keep the container running. This is called the **detached** mode. |
17 | 21 |
|
18 | 22 | Before we look at the **detached** mode, we should first find out a way to stop the container that you have just launched.
|
19 | 23 |
|
@@ -235,7 +239,7 @@ But first we will install the Python pip package to the alpine linux distributio
|
235 | 239 | RUN apk add --update py-pip
|
236 | 240 | ```
|
237 | 241 |
|
238 |
| -Next, let us add the files that make up the Flask Application. |
| 242 | +Next, let's add the files that make up the Flask Application. |
239 | 243 |
|
240 | 244 |
|
241 | 245 | Install all Python requirements for our app to run. This will be accomplished by adding the lines:
|
|
0 commit comments