version: "3"

services:
  web:
    container_name: local_web
    build:
      context: ./web
    depends_on:
      - db
    networks:
      - dgs
    volumes:
      - ./web/sites-enabled:/etc/apache2/sites-enabled
      - ../..:/var/www/html
      - ../../local-data/apache-logs:/var/log/apache2
    links:
      - db:local_db
    expose:
      - "80"
    ports:
      - "80:80"

  db:
    container_name: local_db
    image: mariadb:5.5
    networks:
      - dgs
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: dragon
    volumes:
      - dgs_db:/var/lib/mysql
      - ./mariadb/conf.d:/etc/mysql/conf.d
      - ./mariadb/init-db:/docker-entrypoint-initdb.d
      - ../../local-data/db:/mnt/data
    expose:
      - "3307"
    ports:
      - "3307:3306"

  adminer:
    container_name: adminer
    image: adminer
    networks:
      - dgs
    ports:
      - "8080:8080"

  mailhog:
    container_name: mailhogger
    image: mailhog/mailhog:v1.0.0
    networks:
      - dgs
    ports:
      - "1025:1025"
      - "8025:8025"

networks:
  dgs:

volumes:
  dgs_db:

