- Created a
Dockerfilein newly created directory with following content:
FROM nginx
COPY index.html /var/lib/docker/volume/my_volume/nginx- Create an
index.htmlfile in same directory with following content:
GNU nano 6.2 index.html
<!doctype html>
<html lang="en">
<head>
<p>Hello, World!</p>
</head>
<body>
</html>- Create a
docker-compose.ymlfile in same directory with following content:
version: '3'
services:
web:
build: .
ports:
- "8080:80"
volumes:
- /var/lib/docker/volumes/my_volume/nginx:/usr/share/nginx/html
db:
image: mysql
volumes:
- /var/lib/docker/volumes/my_volume/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: mysql
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
ports:
- "8081:3306"-
Run the following command to UP the containers:
$ docker compose up -d -
after making some changes in docker file and rebuilding image, below is the new message that is hown:

-
For scalling,
docker-compose.ymlis edited as followed:
version: '3'
services:
web:
build: .
volumes:
- /var/lib/docker/volumes/my_volume/nginx:/usr/share/nginx/html
db:
image: mysql
volumes:
- /var/lib/docker/volumes/my_volume/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: mysql
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
ports:
- "8081:3306"- Run the following command:
$ docker-compose up -d --scale web=5 - the successfull output is:

- To install
Grafana, run following command:
$ docker run -d -p 3000:3000 grafana/grafana-enterprise

