# yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-go/master/schema/compose-spec.json
# Development environment override
services:
  php:
    build:
      context: .
      target: frankenphp_dev
    volumes:
      - ./:/app
      - ~/.composer/cache:/root/.composer/cache
      - ./frankenphp/Caddyfile:/etc/caddy/Caddyfile:ro
      - ./frankenphp/conf.d/20-app.dev.ini:/usr/local/etc/php/app.conf.d/20-app.dev.ini:ro
      - ./frankenphp/data:/data
      - sass:/app/var/sass
    environment:
      MERCURE_EXTRA_DIRECTIVES: demo
      # See https://xdebug.org/docs/all_settings#mode
      XDEBUG_MODE: "${XDEBUG_MODE:-off}"
      MAILER_DSN: "smtp://mailer:1025"
    extra_hosts:
      # Ensure that host.docker.internal is correctly defined on Linux
      - host.docker.internal:host-gateway
    tty: true
    ports:
      # HTTP
      - target: 80
        published: ${HTTP_PORT:-80}
        protocol: tcp
      # HTTPS
      - target: 443
        published: ${HTTPS_PORT:-443}
        protocol: tcp
      # HTTP/3
      - target: 443
        published: ${HTTP3_PORT:-443}
        protocol: udp
  sass:
    image: ${IMAGES_PREFIX:-}app-php
    volumes:
      - ./:/app:ro
      - sass:/app/var/sass
    entrypoint: ''
    depends_on:
      - php
    command:
      - bin/console
      - sass:build
      - --watch
      - -v
    healthcheck:
      disable: true
  
  ###> symfony/mercure-bundle ###
  ###< symfony/mercure-bundle ###
  
  ###> doctrine/doctrine-bundle ###
  database:
    ports:
      - "5432:5432"
  ###< doctrine/doctrine-bundle ###
  
  ###> symfony/mailer ###
  mailer:
    image: axllent/mailpit
    ports:
      - "1025"
      - "8025:8025"
    environment:
      MP_SMTP_AUTH_ACCEPT_ANY: 1
      MP_SMTP_AUTH_ALLOW_INSECURE: 1
  ###< symfony/mailer ###

volumes:
  sass:
