chore: deduplicate compose environment blocks

Use YAML anchor x-app-env for the shared worker/web environment vars.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Frank Schwenk
2026-07-18 17:11:28 +02:00
parent 5a3118f590
commit 86989c1a4c
+12 -20
View File
@@ -8,14 +8,7 @@
# Syncthing itself runs on the host (not in this compose). Copy .env.example # Syncthing itself runs on the host (not in this compose). Copy .env.example
# to .env for local overrides (e.g. DATA_HOST_DIR=./data). Never commit .env. # to .env for local overrides (e.g. DATA_HOST_DIR=./data). Never commit .env.
services: x-app-env: &app-env
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:
DATA_DIR: /data DATA_DIR: /data
OUTPUT_COUNT: ${OUTPUT_COUNT:-3} OUTPUT_COUNT: ${OUTPUT_COUNT:-3}
BLEND_OPACITY: ${BLEND_OPACITY:-30%} BLEND_OPACITY: ${BLEND_OPACITY:-30%}
@@ -28,6 +21,16 @@ services:
REMBG_MODEL: ${REMBG_MODEL:-u2net} REMBG_MODEL: ${REMBG_MODEL:-u2net}
REMBG_ALPHA: ${REMBG_ALPHA:-1} REMBG_ALPHA: ${REMBG_ALPHA:-1}
NICE_LEVEL: ${NICE_LEVEL:-18} 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: volumes:
- ${DATA_HOST_DIR:-/home/frank/sync.schwenk.online/data/livef12}:/data - ${DATA_HOST_DIR:-/home/frank/sync.schwenk.online/data/livef12}:/data
- ./assets:/data/assets:ro - ./assets:/data/assets:ro
@@ -48,18 +51,7 @@ services:
depends_on: depends_on:
- worker - worker
environment: environment:
DATA_DIR: /data <<: *app-env
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}
SITE_TITLE: live.f12.rocks SITE_TITLE: live.f12.rocks
volumes: volumes:
- ${DATA_HOST_DIR:-/home/frank/sync.schwenk.online/data/livef12}:/data - ${DATA_HOST_DIR:-/home/frank/sync.schwenk.online/data/livef12}:/data