services:
  briefs-db:
    restart: unless-stopped

  briefs-web:
    # Nginx Proxy Manager reaches this container over the external `proxy`
    # network. The loopback port is only a host-side diagnostic path.
    ports:
      - "127.0.0.1:8085:80"
    volumes:
      - /var/www/just2done.com/brief:/usr/share/nginx/html/brief:ro
      - ./docker/nginx-brief.conf:/etc/nginx/conf.d/default.conf:ro
    networks:
      - brief-internal
      - proxy

  city-briefing-agent:
    # Local n8n reaches this through an SSH tunnel to 127.0.0.1:8002.
    # Do not publish the agent directly to the internet.
    ports:
      - "127.0.0.1:8002:8000"
    volumes:
      - /var/www/just2done.com/brief:/brief-output
    environment:
      PUBLIC_BASE_URL: https://just2done.com/brief
      INTERNAL_PUBLIC_BASE_URL: http://briefs-web/brief
      BRIEF_OUTPUT_DIR: /brief-output
      OG_COVER_URL: https://just2done.com/brief/og-cover.jpg
      INTERNAL_OG_COVER_URL: http://briefs-web/brief/og-cover.jpg
    networks:
      - brief-internal
      - proxy

networks:
  proxy:
    external: true
