Initial commit — StreamStack v1
Five-service streaming platform: auth, catalogue, streaming, ingest, thumbnailer. Includes React frontend served by nginx, NATS JetStream event bus, aiobotocore async S3, PyAV video metadata + thumbnail extraction, service-to-service JWT auth, and a full unit + e2e test suite.
This commit is contained in:
@@ -0,0 +1,185 @@
|
||||
services:
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_USER: streamstack
|
||||
POSTGRES_PASSWORD: streamstack
|
||||
POSTGRES_DB: streamstack
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U streamstack"]
|
||||
interval: 5s
|
||||
retries: 10
|
||||
|
||||
nats:
|
||||
image: nats:2.10-alpine
|
||||
command: ["-js", "-m", "8222"]
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8222/healthz"]
|
||||
interval: 5s
|
||||
retries: 10
|
||||
|
||||
minio:
|
||||
image: quay.io/minio/minio:latest
|
||||
command: server /data --console-address ":9001"
|
||||
environment:
|
||||
MINIO_ROOT_USER: minioadmin
|
||||
MINIO_ROOT_PASSWORD: minioadmin
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
||||
interval: 5s
|
||||
retries: 10
|
||||
|
||||
minio-init:
|
||||
image: quay.io/minio/mc:latest
|
||||
depends_on:
|
||||
minio:
|
||||
condition: service_healthy
|
||||
entrypoint: >
|
||||
/bin/sh -c "
|
||||
mc alias set local http://minio:9000 minioadmin minioadmin &&
|
||||
mc mb --ignore-existing local/media &&
|
||||
mc mb --ignore-existing local/thumbnails
|
||||
"
|
||||
|
||||
auth:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
SERVICE: auth
|
||||
environment:
|
||||
SERVICE: auth
|
||||
DATABASE_URL: postgresql+asyncpg://streamstack:streamstack@postgres:5432/streamstack
|
||||
NATS_URL: nats://nats:4222
|
||||
JWT_PRIVATE_KEY_PATH: /run/jwt-keys/private.pem
|
||||
JWT_PUBLIC_KEY_PATH: /run/jwt-keys/public.pem
|
||||
JWT_ALGORITHM: RS256
|
||||
JWT_EXPIRE_MINUTES: "30"
|
||||
JWT_REFRESH_EXPIRE_DAYS: "7"
|
||||
volumes:
|
||||
- ./tests/e2e/keys:/run/jwt-keys:ro
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nats:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8000/v1/health"]
|
||||
interval: 10s
|
||||
retries: 5
|
||||
|
||||
catalogue:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
SERVICE: catalogue
|
||||
environment:
|
||||
SERVICE: catalogue
|
||||
DATABASE_URL: postgresql+asyncpg://streamstack:streamstack@postgres:5432/streamstack
|
||||
NATS_URL: nats://nats:4222
|
||||
S3_ENDPOINT_URL: http://minio:9000
|
||||
S3_ACCESS_KEY: minioadmin
|
||||
S3_SECRET_KEY: minioadmin
|
||||
S3_BUCKET_MEDIA: media
|
||||
AUTH_SERVICE_URL: http://auth:8000
|
||||
STREAMING_SERVICE_URL: http://streaming:8000
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nats:
|
||||
condition: service_healthy
|
||||
auth:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8000/v1/health"]
|
||||
interval: 10s
|
||||
retries: 5
|
||||
|
||||
streaming:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
SERVICE: streaming
|
||||
environment:
|
||||
SERVICE: streaming
|
||||
NATS_URL: nats://nats:4222
|
||||
S3_ENDPOINT_URL: http://minio:9000
|
||||
S3_ACCESS_KEY: minioadmin
|
||||
S3_SECRET_KEY: minioadmin
|
||||
S3_BUCKET_MEDIA: media
|
||||
AUTH_SERVICE_URL: http://auth:8000
|
||||
depends_on:
|
||||
nats:
|
||||
condition: service_healthy
|
||||
minio:
|
||||
condition: service_healthy
|
||||
auth:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8000/v1/health"]
|
||||
interval: 10s
|
||||
retries: 5
|
||||
|
||||
ingest:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
SERVICE: ingest
|
||||
environment:
|
||||
SERVICE: ingest
|
||||
NATS_URL: nats://nats:4222
|
||||
S3_ENDPOINT_URL: http://minio:9000
|
||||
S3_ACCESS_KEY: minioadmin
|
||||
S3_SECRET_KEY: minioadmin
|
||||
S3_BUCKET_MEDIA: media
|
||||
S3_BUCKET_THUMBNAILS: thumbnails
|
||||
AUTH_SERVICE_URL: http://auth:8000
|
||||
CATALOGUE_SERVICE_URL: http://catalogue:8000
|
||||
depends_on:
|
||||
nats:
|
||||
condition: service_healthy
|
||||
minio:
|
||||
condition: service_healthy
|
||||
auth:
|
||||
condition: service_healthy
|
||||
catalogue:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8000/v1/health"]
|
||||
interval: 10s
|
||||
retries: 5
|
||||
|
||||
nginx:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.nginx
|
||||
depends_on:
|
||||
- streaming
|
||||
- catalogue
|
||||
- auth
|
||||
- ingest
|
||||
|
||||
e2e-tests:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.test
|
||||
environment:
|
||||
GATEWAY_URL: http://nginx:80
|
||||
S3_ENDPOINT_URL: http://minio:9000
|
||||
S3_ACCESS_KEY: minioadmin
|
||||
S3_SECRET_KEY: minioadmin
|
||||
S3_BUCKET_MEDIA: media
|
||||
depends_on:
|
||||
nginx:
|
||||
condition: service_started
|
||||
streaming:
|
||||
condition: service_healthy
|
||||
catalogue:
|
||||
condition: service_healthy
|
||||
auth:
|
||||
condition: service_healthy
|
||||
ingest:
|
||||
condition: service_healthy
|
||||
minio-init:
|
||||
condition: service_completed_successfully
|
||||
command: ["uv", "run", "--extra", "dev", "pytest", "tests/e2e/", "-v"]
|
||||
Reference in New Issue
Block a user