version: '3.8'

services:
  apache:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: cite_practica_apache
    ports:
      - "80:80"
    volumes:
      # Монтируем папку public как DocumentRoot (динамическое обновление)
      - ./public:/var/www/html/cite_practica:rw
      # Монтируем конфигурацию для виртуальных хостов
      - ./docker/apache/vhosts.conf:/etc/apache2/sites-available/000-default.conf:ro
    environment:
      - APACHE_DOCUMENT_ROOT=/var/www/html/cite_practica
    command: >
      bash -c "
      echo '127.0.0.1 admin' >> /etc/hosts &&
      apache2-foreground
      "
    networks:
      - cite_practica_network
    restart: unless-stopped

networks:
  cite_practica_network:
    driver: bridge

