containerization-and-devops

Class 8 Part 1 - Docker Compose Lab

docker-compose.yml

version: '3.8'
services:
  nginx:
    image: nginx:alpine
    container_name: my-nginx
    ports:
      - "8080:80"
    volumes:
      - ./html:/usr/share/nginx/html
    environment:
      - NGINX_HOST=localhost
    restart: unless-stopped

Step 1

Command Used

docker compose up -d

Step 1


Step 2

Command Used

docker compose up -d

Step 2


Step 3

Command Used

docker ps

Step 3


Step 4

Command Used

docker compose down

Step 4


Step 5

Command Used

docker ps

Step 5


Step 6

Command Used

docker compose up

Step 6


Step 7

Command Used

docker compose down

Step 7


Step 8

Command Used

docker compose logs -f

Step 8


Step 9

Command Used

Access in browser: http://localhost:8080

Step 9


Step 10

Command Used

docker compose ps

Step 10



<- Previous Class | Theory Index | Next Class ->