version: '3.9'
services:
  serveur-web:
    container_name: srj-mon-serveur
    build:
      context: .
      dockerfile: Dockerfile-apache
    volumes:
      - type: bind
        source: ./
        target: /var/www/html
    ports:
      - 8000:80
      - 443:443
    depends_on:
      - serveur-mysql

  serveur-mysql:
    container_name: srj-mon-sql
    ports:
      - "3306:3306"
    build:
      context: .
      dockerfile: Dockerfile-mysql
    environment:
      MYSQL_ROOT_PASSWORD: "proweb"
      MYSQL_DATABASE: "ma-bd"
    volumes:
      - dbData:/var/lib/mysql

  phpmyadmin:
    container_name: srj-mon-phpmyadmin
    image: phpmyadmin/phpmyadmin
    restart: always
    links:
      - serveur-mysql
    ports:
      - "8081:80"
    environment:
      PMA_HOST: serveur-mysql
      MYSQL_ROOT_PASSWORD: proweb
      UPLOAD_LIMIT: 300M
volumes:
  dbData:
