Files
livef12rocks/compose.yml
T
Frank Schwenk c03f17488c
CI / lint-and-test (push) Failing after 1m18s
feat: organizer Android app and token-gated upload API
Replace Syncthing as the product upload path with a share-target app
and POST /api/jobs. Web UI live-polls job progress.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-27 21:38:50 +02:00

77 lines
2.4 KiB
YAML

# live.f12.rocks — event photo pipeline: Android upload -> gmic/rembg -> web.
#
# worker + web share one host directory:
# ${DATA_HOST_DIR:-/home/frank/sync.schwenk.online/data/livef12} -> /data
# worker watches /data/incoming, writes /data/variants + /data/intermediates
# web serves HTML + /api (POST /api/jobs needs UPLOAD_TOKEN)
#
# Copy .env.example to .env for local overrides (DATA_HOST_DIR=./data,
# UPLOAD_TOKEN=...). Never commit .env.
x-app-env: &app-env
DATA_DIR: /data
OUTPUT_COUNT: ${OUTPUT_COUNT:-3}
BLEND_OPACITY: ${BLEND_OPACITY:-30%}
BLEND_OPACITY_MIN: ${BLEND_OPACITY_MIN:-10}
BLEND_OPACITY_MAX: ${BLEND_OPACITY_MAX:-50}
FILTER_TIMEOUT: ${FILTER_TIMEOUT:-120}
FILTER_TIMEOUT_LONG: ${FILTER_TIMEOUT_LONG:-300}
MAX_FILTER_ATTEMPTS: ${MAX_FILTER_ATTEMPTS:-8}
MAX_EDGE_PX: ${MAX_EDGE_PX:-2000}
REMBG_MODEL: ${REMBG_MODEL:-u2net}
REMBG_ALPHA: ${REMBG_ALPHA:-1}
NICE_LEVEL: ${NICE_LEVEL:-18}
services:
worker:
build: .
restart: unless-stopped
# Same UID as Syncthing (PUID=1002) so shared /data stays writable.
user: "1002:1002"
command: ["python3", "-m", "app.worker"]
environment:
<<: *app-env
volumes:
- ${DATA_HOST_DIR:-/home/frank/sync.schwenk.online/data/livef12}:/data
- ./assets:/data/assets:ro
- rembg_cache:/app/.home
# Sequential-only by design (no threads/async in worker.py); these
# limits just make sure gmic/rembg can't starve the host too.
# Keep headroom on the ~8GB host — birefnet-general needs more than we have.
cpus: "1.0"
mem_limit: 4g
networks:
- internal
web:
build: .
restart: unless-stopped
user: "1002:1002"
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
depends_on:
- worker
environment:
<<: *app-env
SITE_TITLE: live.f12.rocks
UPLOAD_TOKEN: ${UPLOAD_TOKEN:-}
volumes:
- ${DATA_HOST_DIR:-/home/frank/sync.schwenk.online/data/livef12}:/data
- ./assets:/data/assets:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.livef12rocks.rule=Host(`live.f12.rocks`)"
- "traefik.http.routers.livef12rocks.entrypoints=websecure"
- "traefik.http.routers.livef12rocks.tls.certresolver=myresolver"
- "traefik.http.services.livef12rocks.loadbalancer.server.port=8000"
networks:
- internal
- traefik
networks:
internal: {}
traefik:
external: true
volumes:
rembg_cache: