version: '2'

services:
  db:
    image: mysql:5.7
    env_file:
      - .env

  nginx:
    build: docker/nginx
    container_name: nginx
    ports:
      - ${HTTPD_PORT}:8080
    volumes:
      - ./docker/nginx/default:/etc/nginx/sites-available/default:ro
      - .:/var/www/gestion-rgpd/:delegated
    depends_on:
      - php

  php:
    build: docker/php
    container_name: php
    ports:
      - ${PHP_FPM_PORT}:9000
    volumes:
      - ./docker/php/fpm-pool.conf:/etc/php/7.1/fpm/pool.d/www.conf:ro
      - .:/var/www/gestion-rgpd/:delegated
    working_dir: /var/www/gestion-rgpd/
    depends_on:
      - db

