version: "3.7"

services:
  web:
    container_name: claroline-web
    build:
      context: .
      dockerfile: .docker.dev/web/Dockerfile
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - ./:/var/www/html/claroline
    depends_on:
      - db
    environment:
      - APP_URL=claroline.example.com
      - ENV=DEV
      - APP_ENV=dev
      - APP_DEBUG=1
      - NODE_ENV=development
      - DB_HOST=claroline-db
      - DB_NAME=claroline
      - DB_USER=claroline
      - DB_PASSWORD=claroline
      - SECRET="secret-claroline"
      - ADMIN_FIRSTNAME=John
      - ADMIN_LASTNAME=Doe
      - ADMIN_USERNAME=root
      - ADMIN_PASSWORD=claroline
      - ADMIN_EMAIL=claroline@example.com
      - PLATFORM_NAME=Claroline
      - PLATFORM_SUPPORT_EMAIL=claroline@example.com
    networks:
      claroline_network:
        ipv4_address: 172.22.9.6

  db:
    container_name: claroline-db
    environment:
      MYSQL_ROOT_PASSWORD: claroline
      MYSQL_USER: claroline
      MYSQL_PASSWORD: claroline
      MYSQL_DATABASE: claroline
    image: mysql:8.0
    ports:
      - "3306:3306"
    volumes:
      - ../mysql:/var/lib/mysql
      - ./.docker.dev/mysql:/etc/mysql/conf.d
    networks:
      claroline_network:
        ipv4_address: 172.22.9.5

networks:
  claroline_network:
    ipam:
      config:
        - subnet: 172.22.9.0/24
