version: "3.4"

# Development environment override
services:
  php:
    build:
      target: api_platform_php_dev
    volumes:
      - ./api:/srv/api:rw,cached
      - ./api/docker/php/conf.d/api-platform.dev.ini:/usr/local/etc/php/conf.d/api-platform.ini
      # if you develop on Linux, you may use a bind-mounted host directory instead
      # - ./api/var:/srv/api/var:rw
    environment:
      APP_ENV: dev
      # XDEBUG_MODE required for step debugging
      XDEBUG_MODE: debug
      # default port for Xdebug 3 is 9003
      # idekey=VSCODE if you are debugging with VSCode
      XDEBUG_CONFIG: >-
        client_host=172.17.0.1
        idekey=PHPSTORM 
      # This should correspond to the server declared in PHPStorm `Preferences | Languages & Frameworks | PHP | Servers`
      # Then PHPStorm will use the corresponding path mappings
      PHP_IDE_CONFIG: serverName=paraboro-api

  pwa:
    build:
      context: ./pwa
      target: api_platform_pwa_dev
    volumes:
      - ./pwa:/usr/src/pwa:rw,cached

  caddy:
    volumes:
      - ./api/docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
      - ./api/public:/srv/api/public:ro
    environment:
      MERCURE_EXTRA_DIRECTIVES: demo

###> doctrine/doctrine-bundle ###
  database:
    ports:
      - target: 3306
        published: ${DB_PORT:-3306}
        protocol: tcp
###< doctrine/doctrine-bundle ###

###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###
