# Local development convenience only — copy to ../../docker-compose.override.yml
# (repo root) if you want to run `php artisan` / `npm run dev` directly on the
# host while MySQL/Redis run in Docker, and/or want `docker compose up` to
# have a working Storage Agent so uploads/downloads actually work locally
# (docker-compose.yml alone only brings up the VPS stack — the real Storage
# Agent lives in docker-compose.pi.yml, which assumes a separate WireGuard-
# connected host and isn't meant to be combined with docker-compose.yml
# directly). Do not use this file in staging or production — the base
# docker-compose.yml intentionally publishes no database ports at all, and
# production's real Storage Agent must bind only to the WireGuard interface,
# never 0.0.0.0 as this dev-only container does.
services:
  mysql:
    ports:
      - "127.0.0.1:3306:3306"

  redis:
    ports:
      - "127.0.0.1:6379:6379"

  # Lets `docker compose up` alone give you a fully working local stack.
  # Set STORAGE_AGENT_URL=http://storage-agent:9200 in your root .env to
  # use it (the backend/worker/scheduler containers reach it by service
  # name over the same `internal` network defined in docker-compose.yml).
  storage-agent:
    build:
      context: ../../storage-agent
      dockerfile: Dockerfile
    environment:
      HOST: 0.0.0.0
      PORT: 9200
      DATA_DIR: /data/objects
      AUTH_TOKEN: ${STORAGE_AGENT_TOKEN:-dev-local-token}
    volumes:
      - storage_agent_dev_data:/data/objects
    networks:
      - internal

volumes:
  storage_agent_dev_data:
