version: '3.7'


services:
  database:
    image: 'mysql:5.7.26'

    environment:
      MYSQL_ROOT_PASSWORD: Mecanique007
      MYSQL_DATABASE: logercm_api_db
      MYSQL_USER: logercm_itscm
      MYSQL_PASSWORD: Mecanique&007
    ports:
      # To allow the host machine to access the ports below, modify the lines below.
      # For example, to allow the host to connect to port 3306 on the container, you would change
      # "3306" to "3306:3306". Where the first port is exposed to the host and the second is the container port.
      # See https://docs.docker.com/compose/compose-file/#ports for more information.
      - '3306'
  php-fpm:
    build: ./
    ports:
      - 5000:8000
    volumes:
      - ./:/var/www/html
  phpmyadmin:
    depends_on:
      - database
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - '8080:80'
    environment:
      PMA_HOST: mysql
  nginx:
    container_name: nginx
    image: nginx:stable-alpine
    ports:
      - '8080:80'
    volumes:
      - ./app:/var/www/symfony_docker
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - php-fpm
      - database
