services:
  postgres:
    image: pgvector/pgvector:pg17
    environment: {POSTGRES_USER: fde, POSTGRES_PASSWORD: fde_local_only, POSTGRES_DB: analytics}
    ports: ["5432:5432"]
    volumes: [pgdata:/var/lib/postgresql/data, ./sql/init:/docker-entrypoint-initdb.d:ro]
    healthcheck: {test: ["CMD-SHELL", "pg_isready -U fde"], interval: 5s, retries: 10}
  minio:
    image: minio/minio
    command: server /data --console-address ":9001"
    environment: {MINIO_ROOT_USER: minio, MINIO_ROOT_PASSWORD: minio_local_only}
    ports: ["9000:9000", "9001:9001"]
    volumes: [miniodata:/data]
  phoenix:
    image: arizephoenix/phoenix:latest
    ports: ["6006:6006", "4317:4317"]
  jupyter:
    image: quay.io/jupyter/scipy-notebook
    ports: ["8888:8888"]
    volumes: [./notebooks:/home/jovyan/work, ./data:/home/jovyan/data]
  sandbox:                         # Week 9 code-interpreter target
    image: quay.io/jupyter/scipy-notebook
    network_mode: none
    mem_limit: 2g
    cpus: 1.0
    volumes: [./sandbox:/home/jovyan/work, ./data/extracts:/home/jovyan/data:ro]
    command: ["sleep", "infinity"]
    profiles: ["sandbox"]
  localstack:                      # optional; needs LOCALSTACK_AUTH_TOKEN; Hobby plan = non-commercial
    image: localstack/localstack
    environment: {LOCALSTACK_AUTH_TOKEN: "${LOCALSTACK_AUTH_TOKEN}"}
    ports: ["4566:4566"]
    profiles: ["aws-emu"]
volumes: {pgdata: {}, miniodata: {}}