version: "3.8"
services:
  web:
    image: nginx:alpine
    depends_on:
      - fpm
    volumes:
      - ./:/app
      - ./docker/development/nginx/default.conf:/etc/nginx/conf.d/default.conf
    environment:
      VIRTUAL_HOST: budget.localhost
      VIRTUAL_PORT: 80
    ports:
      - 8855:80
    networks:
      - default

  fpm:
    build:
      context: ./docker/development/php
      dockerfile: php.docker
      target: debug
    volumes:
      - ./:/app
    restart: always
    environment:
      XDEBUG_CONFIG: "idekey=PHPSTORM_BUDGET client_host=172.17.0.1 client_port=9008"
      PHP_IDE_CONFIG: "serverName=budget.localhost"
      XDEBUG_MODE: debug,coverage
    expose:
      - 9000
    networks:
      - default

networks:
  default:
