version: '3'
services:
  web:
    build: .
    container_name: apachephp
    ports:
      - "80:80"
    volumes:
      - ./www:/var/www/html
    extra_hosts:
      - "host.docker.internal:host-gateway"
  db:
    container_name: mysql8
    image: mysql:8.0
    command: mysqld --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: sandbox
      #MYSQL_USER: myuser
      #MYSQL_PASSWORD: password
    ports:
      - "3306:3306"
    volumes:
      - './docker/db/data:/var/lib/mysql'
      - './docker/db/my.cnf:/etc/mysql/conf.d/my.cnf'
      - './docker/db/sql:/docker-entrypoint-initdb.d'
volumes:
  db_data:
