services:

  php:
    build:
      dockerfile: Dockerfile
    ports:
      - ${PHP_PORT}:9001
    env_file:
      - .env
    networks:
      - network_default
    volumes:
      - ./backend/:/application

  nginx:
    build:
      context: ./docker/nginx
    ports:
      - ${NGINX_PORT}:80
    depends_on:
      - php
    environment:
      - NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx/conf.d
      - NGINX_ENVSUBST_TEMPLATE_DIR=/etc/nginx/templates
      - NGINX_ENVSUBST_TEMPLATE_SUFFIX=.template
    env_file:
      - .env
    networks:
      - network_default
    volumes:
      - ./logs/nginx:/var/log/nginx:cached
      - ./backend/public:/application/public

networks:
  network_default:
    driver: bridge
