version: '3.8'

services:
  web:
    image: nginx:latest
    container_name: web-container
    hostname: webserver
    ports:
      - "8080:80"
    networks:
      - my-network
  web-2:
    image: nginx:latest
    container_name: web-container-2
    hostname: webserver
    ports:
      - "8081:80"
    networks:
      - my-network

  db:
    image: mysql:8
    container_name: db-container
    hostname: database
    environment:
      - MYSQL_ROOT_PASSWORD=mypassword
    networks:
      - my-network

networks:
  my-network:
    driver: bridge