# Development overrides - automatically merged with compose.yaml
services:
  php:
    build:
      context: ./api
      target: frankenphp_dev
    volumes:
      - ./api:/app
      - /app/var
      - ./api/frankenphp/Caddyfile:/etc/caddy/Caddyfile:ro
      - ./api/frankenphp/conf.d/app.dev.ini:/usr/local/etc/php/conf.d/app.dev.ini:ro
      - ./data:/srv/data:ro
    environment:
      XDEBUG_MODE: "${XDEBUG_MODE:-off}"
    extra_hosts:
      - host.docker.internal:host-gateway
    tty: true

  pwa:
    build:
      context: ./pwa
      target: dev
    volumes:
      - ./pwa:/srv/app
    environment:
      WATCHPACK_POLLING: "true"

  database:
    ports:
      - target: 5432
        published: ${POSTGRES_PORT:-5432}

  pgadmin:
    image: dpage/pgadmin4:latest
    environment:
      PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL:-admin@admin.com}
      PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD:-admin}
      PGADMIN_CONFIG_SERVER_MODE: "False"
      PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: "False"
    ports:
      - target: 80
        published: ${PGADMIN_PORT:-5050}
    depends_on:
      database:
        condition: service_healthy
    volumes:
      - pgadmin_data:/var/lib/pgadmin
