services:
###> doctrine/doctrine-bundle ###
  database:
    container_name: wh2-db
    image: mysql:5.7
    ports:
      - ${DB_PORT}:3306
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_ROOT_HOST=%
    volumes:
      - ./docker/_mysql:/var/lib/mysql:rw
    user: mysql
    networks:
      - wh2-network
      # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
      # - ./docker/db/data:/var/lib/postgresql/data:rw
    ###< doctrine/doctrine-bundle ###
    restart: no
  pma:
    container_name: wh2-pma
    image: phpmyadmin/phpmyadmin
    environment:
      - PMA_ARBITRARY=1
      - PMA_HOST=database
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - PMA_USER=${MYSQL_USER}
      - PMA_PASSWORD=${MYSQL_PASSWORD}
    ports:
      - ${PMA_PORT}:80
    networks:
      - wh2-network
    links:
      - database
    depends_on:
      - database
    restart: no
  pma-root:
    container_name: wh2-pma-root
    image: phpmyadmin/phpmyadmin
    environment:
      - PMA_ARBITRARY=1
      - PMA_HOST=database
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - PMA_USER=root
      - PMA_PASSWORD=${MYSQL_ROOT_PASSWORD}
    ports:
      - ${PMA_ROOT_PORT}:80
    networks:
      - wh2-network
    links:
      - database
    depends_on:
      - database
    restart: no
networks:
  wh2-network:
    driver: bridge