This will be a very brief tutorial on Docker: we'll take a 'nginx' docker image and build a simple web server on Docker container. In that process, we can get a quick taste of how Docker is working. We'll learn: How to get an official image. How to use the files on host machine from our container. How to copy the files from our host to the. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. The Apache HTTP Server ('httpd') was launched in 1995 and it has been the most popular web server on the Internet since April 1996. It has celebrated its 20th birthday as a project in February 2015. Deploy A Static Website with Docker The static websites are the HTML pages, directly severed by any web servers. It may also include some other static assets like css, js and images. In this tutorial you will learn, how to deploy a static website on Docker container.
The static websites are the HTML pages, directly severed by any web servers. It may also include some other static assets like css, js and images. In this tutorial you will learn, how to deploy a static website on Docker container.
Docker Apache Web Server Software
1. Create A Static Website
We assume you already have a static site on your system. For this tutorial, I have downloaded a static website from here. After making some changes, placed all files in a directory on Docker server.
2. Create Dockerfile
Next, create a Dockerfile in the same directory. Edit your Dockerfile in your favorite text editor:
Choose one of the below content for your Dockerfile in regards to web server.
To Use Nginx Web server
To Use Apache Web server
Based on the comparison about Apache vs Nginx to run static site. We prefer to go with the Nginx web server.
3. Build Docker Image
Now, You have a Dockerfile for your static site. You can now create a docker image with these files. To create a Docker image run:
The above command will create a Docker image with name img-static-site-example. Use “docker images” command to list available images on local system.
4. Run Docker Container
Now, you have a docker image now. Use this docker image to launch a new container on your system. To run your Docker container using the newly created image, type:
In case the port 80 is occupied by the host machine or any other docker container. You can change the host machine port to something else.
Anime hair is often based on real hairstyles but tends to be drawn in clumps rather than individual strands. One good reason for this is that if you are drawing multiple frames of animation or multiple panels of a manga it will simply be too time consuming to draw. Anime girl hair drawings like aphmau's. Oct 30, 2019 - Explore Anastasia Zavalisina's board 'anime hair' on Pinterest. See more ideas about anime hair, how to draw hair, hair reference.
The “-d” option detach the container from current shell and run in background. This will print container ID on screen.
Use “docker ps” command to view the running container. In case you didn’t find any container, use “docker ps -a” to view all containers (in any state) on your machine.
5. Access Your Application
Once the container is up and running. All the on port 8080 of host machine will be redirected to container’s port 80.
Access you docker host using IP address (or hostname/domain name) on port 8080 to view application.
6. Add Docker Compose (Optional)
Docker Apache Web Server Tutorial
Before start using docker compose, You must have docker-compose binary on your system. Use this tutorial to get docker-compose on your system.
This will help you to easily rebuild docker images and re-create containers without stopping and creating them manually.
Let’s create a file in current directory with name docker-compose.yml.
Add the following content.
Now, build your docker image. This will create a docker image with the help of Dockerfile available in current directory.
Then run your docker container using the following command.
Once you have the docker container up and running. You can rebuild image and recreate your container any time by running these two commands.
For example, you have make a change your site. Just run these two commands on terminal.
This will rebuild the docker image and recreate the docker container as showing in the screenshot:
In this tutorial, you learn how to deploy a static site with docker containers. If this tutorial help you, please do not forgot to thump up and share with your social network.