services:
  # Mysql database container
  db:
    image: mysql
    container_name: kplan_db
    restart: always
    volumes:
      - db_data:/var/lib/mysql
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
    ports:
      - 3305:3306
    networks:
      - kplan

  # phpmyadmin container
  phpmyadmin:
    image: phpmyadmin
    container_name: kplan_phpmyadmin
    restart: always
    depends_on:
      - db
    ports:
      - 8082:80
    environment:
      PMA_HOST: db
    networks:
      - kplan

  # Symfony apache project container
  www:
    build: docker/php
    container_name: kplan_www
    ports:
      - "8742:80"
    volumes:
      - ./docker/php/vhosts:/etc/apache2/sites-enabled
      - ./:/var/www
    restart: always
    networks:
      - kplan

networks:
  kplan:

volumes:
  db_data:
