services:
  app:
    container_name: ${CONTAINER_NAME}_app
    build:
      context: ./docker/php
      target: app-dev
      args:
        COMPOSER_AUTH: "{}"
        APP_BASE_DIR: ${APP_BASE_DIR-.}
    restart: unless-stopped
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - ${APP_BASE_DIR-.}:/app

  web:
    container_name: ${CONTAINER_NAME}_web
    build:
      context: ./docker/nginx
      target: web-dev
      args:
        APP_BASE_DIR: ${APP_BASE_DIR-.}
    restart: unless-stopped
    ports:
      - ${NGINX_PORT}:80
    environment:
      PHP_FPM_HOST: app
    volumes:
      - ${APP_BASE_DIR-.}:/app/public
    depends_on:
      - app
