Files
siftlode/docker-compose.localdev.yml
T
peter bf99444ded feat(files): every file sits in a library folder, and keeps its own expiry
The Files library starts here. A user's every download, clip and upload now
lands in a source folder made per origin (YouTube, Plex clips, uploads, one per
other site), decided once in downloads/folders.py at every place a job is made.
How long a file stays moves from the shared asset to the user's job: stamped
from its folder when it is done, never for a file the user keeps. The GC warns
each user once, then takes the expired file out of their library; the cache cap
never evicts a kept file, and an evicted one leaves every holder's library.

The media mount is /files now (FILES_ROOT, FILES_HOST_PATH, volume
siftlode_files); docs/self-hosting.md says how to carry an old volume over.
Migration 0102 places every existing job and carries each done file's expiry
over from its asset.

safe_abs_path takes a missing path and answers None, which drops one baselined
type error.
2026-10-11 03:30:34 +02:00

58 lines
2.5 KiB
YAML

# Self-contained local development stack — Postgres + API + scheduler + worker, all on this machine.
# An OVERRIDE of docker-compose.yml, not a copy of it: only what local development changes lives
# here, so the two cannot drift apart (they had — the worker here lost its wait for the API's
# migrations).
#
# docker compose -f docker-compose.yml -f docker-compose.localdev.yml up -d --build
#
# Fully decoupled: its own local database (a Docker volume) and its own scheduler, so there is no
# shared DB and no migration coupling with any other instance. Browse at http://localhost:8080 —
# Google login works because the OAuth redirect is http://localhost:8080/auth/callback. The API runs
# `alembic upgrade head` on startup, so it applies local migrations to THIS local DB only. Seed the
# catalog once with a pg_dump from another instance if you want real data (see RUNBOOK).
services:
db:
# Harmless on Docker Desktop; needed on some nested/hardened Docker hosts (every service below).
security_opt:
- apparmor:unconfined
api:
environment:
# This instance owns its scheduler (its own DB, so no double-write concern).
SCHEDULER_ENABLED: "true"
# Plex HLS remux scratch on fast container-local storage (the /files bind-mount is a slow
# Windows Docker Desktop mount in dev; prod uses fast local disk so it keeps the default).
PLEX_HLS_DIR: /var/tmp/plex-hls
security_opt:
- apparmor:unconfined
volumes:
# Downloaded media lives on the host so you can inspect the generated Plex tree. Gitignored.
- ./files:/files
- plex_media:/plex-media:ro
worker:
security_opt:
- apparmor:unconfined
volumes:
- ./files:/files
- plex_media:/plex-media:ro
bgutil-pot:
security_opt:
- apparmor:unconfined
volumes:
# OPTIONAL (Plex integration dev testing): the Plex media, mounted READ-ONLY so the container can
# play the physical file locally (this dev box isn't the Plex host). Only referenced when the Plex
# module is enabled; harmless otherwise. Point PLEX_MEDIA_HOST_PATH (.env, gitignored, so no site
# path lives in the tracked compose) at the Docker-Desktop host path (e.g.
# /run/desktop/mnt/host/d/plex-test-media for D:\plex-test-media), mirroring the Plex server's
# /data/<lib>/… layout so plex_path_map (/data=/plex-media) resolves.
plex_media:
driver: local
driver_opts:
type: none
o: bind
device: "${PLEX_MEDIA_HOST_PATH:-/run/desktop/mnt/host/d/plex-test-media}"