Skip to content

sakibbhutta/task5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

task5

  1. Created a Dockerfile in newly created directory with following content:
FROM nginx
COPY index.html /var/lib/docker/volume/my_volume/nginx
  1. Create an index.html file 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>
  1. Create a docker-compose.yml file 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"
  1. Run the following command to UP the containers:

    $ docker compose up -d
  2. The running two containers are as shown: image

  3. Here is the output of localhost:8080 image

  4. after making some changes in docker file and rebuilding image, below is the new message that is hown: image

  5. For scalling, docker-compose.yml is 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"
  1. Run the following command:
    $ docker-compose up -d --scale web=5
  2. the successfull output is: image
  3. To install Grafana, run following command:
$ docker run -d -p 3000:3000 grafana/grafana-enterprise
  1. browse localhost:3000 and enter admin as both username and password.
  2. image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors