version: '3'

networks:
  app-tier:
    driver: bridge

services:
  web:
    image: nginx:1.10
    container_name: protocols_registration_web
    ports:
     - 9023:80
    environment:
     - NGINX_ROOT=/var/www/public
     - SYMFONY_INDEX_FILE=index
     - SYMFONY_DEV_FILE=index
    command: /bin/bash -c "envsubst '$${NGINX_ROOT} $${SYMFONY_INDEX_FILE} $${SYMFONY_DEV_FILE}' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
    volumes:
      - ./:/var/www:cached
      - ./etc/infrastructure/nginx/config/conf.d/default.template:/etc/nginx/conf.d/default.template
      - ./.docker/nginx:/var/log/nginx:delegated
    networks:
      - app-tier
      
  php:
    container_name: protocols_registration_php
    build:
      context: ./etc/infrastructure/php
      dockerfile: Dockerfile
    networks:
      - app-tier
    volumes:
      - ./:/var/www:cached