version: '3'
services:
  phpgps:
    build: .
    ports:
     - "8080:80"
    volumes:
     - "./src:/var/www/html/"
    environment:
     - DB_HOSTNAME=mysql
     - DB_NAME=phpgps
     - DB_USER=phpgps
     - DB_PASSWORD=password
     - DEV_KEY # set dev key here or export as envvar on local machine to passthrough
    networks:
      - test
  mysql:
    image: mysql/mysql-server:8.0
    hostname: mysql
    command: --default-authentication-plugin=mysql_native_password
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=phpgps
      - MYSQL_USER=phpgps
      - MYSQL_PASSWORD=password
    volumes:
      - "./sql:/docker-entrypoint-initdb.d/"
    networks:
      - test
networks:
  test:
