version: '3.8'

services:
  db-e1-layout-historico-api:
    container_name: db-e1-layout-historico-api
    ports:
      - "3310:3306"
    image: mysql
    # NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
    # (this is just an example, not intended to be a production configuration)
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - ./mysql-data:/var/lib/mysql

  php-e1-layout-historico-api:
    container_name: e1-layout-historico-api
    build:
      context: ./php
    ports:
        - '8080:80'
    volumes:
      - .:/var/www/api
      - ./apache/default.conf:/etc/apache2/sites-enabled/000-default.conf
    depends_on:
      - db-e1-layout-historico-api
