# Catodi Music for a household: `docker compose -f compose.music.yaml up -d`, then open http://<this machine>:8097.
# No .env and nothing to fill in. Its own server and its own Postgres (D13): no accounts are shared with Catodi, and
# no worker (D21: the image carries an audio-only ffmpeg). Runs alone or next to deploy/compose.yaml on the same host.
name: catodi-music
services:
  catodi-music:
    image: gitea.mauro.top/urogna/catodi-music:latest
    restart: unless-stopped
    ports:
      - "8097:8096"
    volumes:
      - data:/data
      # The music folders, read-only: Catodi Music never changes a library file.
      # - /path/to/music:/media/music:ro
    networks: [default, db]
    depends_on:
      postgres:
        condition: service_healthy

  # Reached only by the server, on the internal db network, and never published, so it needs no password
  # (the server's default DATABASE_URL is postgres://postgres@postgres/catodi-music).
  postgres:
    image: pgvector/pgvector:pg17
    restart: unless-stopped
    environment:
      POSTGRES_DB: catodi-music
      POSTGRES_HOST_AUTH_METHOD: trust
    volumes:
      - pg:/var/lib/postgresql/data
    networks: [db]
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d catodi-music"]
      interval: 2s
      timeout: 3s
      retries: 30

networks:
  default:
  db:
    internal: true

volumes:
  data:
  pg:
