version: "3"
services:
  mysql:
    image: mysql:5.7
    container_name: project_mysql
    restart: unless-stopped
    networks:
      default:
        ipv4_address: 192.168.2.3
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "true"
      MYSQL_ROOT_PASSWORD:
      MYSQL_DATABASE: project
      MYSQL_USER: root
      MYSQL_PASSWORD:
    ports:
      - "9906:3306"
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: project_phpmyadmin
    links:
      - mysql
    environment:
      PMA_HOST: mysql
      PMA_PORT: 3306
      PMA_ARBITRARY: 1
    networks:
      default:
        ipv4_address: 192.168.2.4
    ports:
      - 81:80

  web:
    build: ./.docker
    container_name: vcfconvert
    networks:
      default:
        ipv4_address: 192.168.2.2
      caddy:
    volumes:
      - ./:/var/www/html/
      - ./.docker/virtualhost.conf:/etc/apache2/sites-available/000-default.conf
    ports:
      - "9080:80"
    depends_on:
      - "mysql"

  mailhog:
    image: mailhog/mailhog
    container_name: project_mailhog
    ports:
      - 1025:1025 # smtp server
      - 8025:8025 # web ui
    networks:
      default:
        ipv4_address: 192.168.2.5

networks:
  default:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 192.168.2.0/24 # If you change this, make sure to change other IP addresses
  caddy:
    external:
      name: caddy_net
