Files
musicshare/docker-compose.yml
T
chrisandClaude Opus 5.5 63d618f0e3 Unlock everything, add a donation link, credit Last.fm, nudge re-linking
- Every feature is free for everyone (the plan system stays for later);
  remaining limits are abuse guards
- Optional website donation link (NEXT_PUBLIC_DONATION_URL). Not shown in
  the mobile apps, where tips to the developer generally need in-app
  purchase
- Last.fm/ListenBrainz-sourced plays link to the user's profile, as
  Last.fm's API terms require
- Connections track when they last saw activity; a scrobbler silent for
  over a week prompts re-linking Spotify (its link expires every 6 months)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzFywujuH9TiuXbr9vjoX8
2026-10-04 08:13:54 -04:00

104 lines
2.6 KiB
YAML

# Full stack: `docker compose up -d --build`, then open http://localhost:3737
# Configuration comes from apps/api/.env (copy apps/api/.env.example first).
x-api: &api
build:
context: .
dockerfile: apps/api/Dockerfile
image: musicshare-api:local
env_file: apps/api/.env
environment:
# Inside the compose network, services reach each other by name.
DATABASE_URL: postgres://musicshare:musicshare@postgres:5432/musicshare
REDIS_URL: redis://redis:6379
extra_hosts:
# Lets the API reach servers on your machine (e.g. a local Jellyfin) as host.docker.internal
- host.docker.internal:host-gateway
init: true
restart: unless-stopped
services:
postgres:
image: postgres:17
environment:
POSTGRES_USER: musicshare
POSTGRES_PASSWORD: musicshare
POSTGRES_DB: musicshare
ports:
- "${POSTGRES_PORT:-5447}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U musicshare -d musicshare"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
redis:
image: redis:7
# Persist to disk so queued jobs and poll schedules survive restarts.
command: ["redis-server", "--appendonly", "yes"]
ports:
- "${REDIS_PORT:-6380}:6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
# Applies database migrations, then exits. The API and worker wait for it.
migrate:
<<: *api
command: ["node", "dist/db/migrate.js"]
restart: "no"
depends_on:
postgres:
condition: service_healthy
api:
<<: *api
ports:
- "${API_PORT:-4000}:4000"
depends_on:
migrate:
condition: service_completed_successfully
redis:
condition: service_healthy
worker:
<<: *api
command: ["node", "dist/worker.js"]
healthcheck:
disable: true
depends_on:
migrate:
condition: service_completed_successfully
redis:
condition: service_healthy
web:
build:
context: .
dockerfile: apps/web/Dockerfile
args:
# The URL the *browser* uses to reach the API.
NEXT_PUBLIC_API_URL: ${PUBLIC_API_URL:-http://localhost:4000}
# Optional donation link shown on the website, e.g. DONATION_URL=https://ko-fi.com/you
NEXT_PUBLIC_DONATION_URL: ${DONATION_URL:-}
image: musicshare-web:local
ports:
- "${WEB_PORT:-3737}:3737"
init: true
restart: unless-stopped
depends_on:
api:
condition: service_healthy
volumes:
pgdata:
redisdata: