services:
  web:
    build:
      context: .
      dockerfile: php/Dockerfile
    ports:
      - "8080:80"
    volumes:
      - .:/var/www/html
      - ./php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini:ro
      - /var/www/html/vendor
    environment:
      PHP_IDE_CONFIG: "serverName=cifexplorer"
      CORS_ALLOWED_ORIGINS: "http://localhost:4200"
    depends_on:
      - db

  db:
    image: mariadb:11
    ports:
      - "3306:3306"
    environment:
      MARIADB_ROOT_PASSWORD: rootpass
      MARIADB_DATABASE: cif_explorer
      MARIADB_USER: cifuser
      MARIADB_PASSWORD: c1fpa55
    volumes:
      - dbdata:/var/lib/mysql
      - ./init:/docker-entrypoint-initdb.d:ro
    command: ["--lower-case-table-names=1", "--skip-ssl"]

volumes:
  dbdata:
