Files
music-hub/docker-compose.prod.yml
Robin Choice 8bf72c2482 Full MVP: workspace layout, visual refresh, PWA, production deploy
Major changes since initial commit:

Schema: version branching (parentVersionId, branchLabel), share links,
guest comments, track status enum (sketch/in_progress/final/released),
track sections, cover art for projects and tracks.

API: 29+ endpoints — auth, projects, tracks, versions, comments, share
links (public + management), uploads (cover), activity feed, onboarding
demo seed. Email templates in German with brand styling.

Web: SvelteKit 5 workspace layout with persistent sidebar, breadcrumb
top-bar, collapsible right panel. SoundCloud-style waveform player with
round play button, avatar comment markers, keyboard shortcuts (Space/JKL/C).
Full German UI. Cover art with gradient fallback. Track status pills.
Activity feed dashboard. Welcome modal with demo-seed trigger. Landing
page with 7-section scroll layout. Login on /login. Public /listen/:token
page for guest feedback.

Visual: Inter Variable font, Magenta→Orange gradient accent, warm dark
neutrals, Lucide-style inline SVG icon set, spring animations on modals,
glass-effect toasts, responsive from 360px to 2560px+.

PWA: manifest, service worker, icons, iOS/Android installable.

Production: adapter-node, server-side API proxy hook, docker-compose with
Postgres + MinIO + auto-migration + health checks. Env example included.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 11:47:48 +02:00

107 lines
2.8 KiB
YAML

services:
# === WEB (Einstiegspunkt, einziger Service mit externem Port) ===
web:
build:
context: .
dockerfile: Dockerfile.web
ports:
- "${PORT:-3000}:3000"
environment:
- NODE_ENV=production
- API_INTERNAL_URL=http://api:3000
depends_on:
api:
condition: service_healthy
restart: unless-stopped
# === API ===
api:
build:
context: .
dockerfile: Dockerfile.api
environment:
- DATABASE_URL=postgresql://musichub:${POSTGRES_PASSWORD}@postgres:5432/musichub
- S3_ENDPOINT=http://minio:9000
- S3_ACCESS_KEY=${S3_ACCESS_KEY:-minioadmin}
- S3_SECRET_KEY=${S3_SECRET_KEY:-minioadmin}
- S3_BUCKET=${S3_BUCKET:-music-hub}
- APP_URL=${APP_URL}
- MAGIC_LINK_SECRET=${MAGIC_LINK_SECRET}
- RESEND_API_KEY=${RESEND_API_KEY:-}
- EMAIL_FROM=${EMAIL_FROM:-Music Hub <noreply@example.com>}
- NODE_ENV=production
depends_on:
postgres:
condition: service_healthy
minio-init:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# === POSTGRES ===
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: musichub
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: musichub
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U musichub"]
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped
# === MINIO (S3-kompatibel) ===
minio:
image: minio/minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY:-minioadmin}
volumes:
- miniodata:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# === MINIO INIT (Bucket anlegen, einmalig) ===
minio-init:
image: minio/mc
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 $${S3_ACCESS_KEY:-minioadmin} $${S3_SECRET_KEY:-minioadmin} &&
mc mb -p local/$${S3_BUCKET:-music-hub} &&
echo 'Bucket ready'
"
# === DB MIGRATION (einmalig bei Deploy) ===
migrate:
build:
context: .
dockerfile: Dockerfile.api
command: bunx drizzle-kit migrate
working_dir: /app/packages/db
environment:
- DATABASE_URL=postgresql://musichub:${POSTGRES_PASSWORD}@postgres:5432/musichub
depends_on:
postgres:
condition: service_healthy
restart: "no"
volumes:
pgdata:
miniodata: