Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (47 loc) · 2.05 KB
/
Copy pathdocker-compose.yml
File metadata and controls
48 lines (47 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Canonical "run it" + "test in Docker" entrypoint.
# docker compose up --build -> build + run on http://localhost:8080
services:
server:
build:
context: .
target: runtime
image: acousticdna:latest
read_only: true # immutable rootfs; all writes go to declared mounts (/data, /tmp)
security_opt:
- no-new-privileges:true # block setuid privilege escalation
cap_drop:
- ALL # server binds 8080 (>1024) + needs no Linux caps
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
ports:
- "${ACOUSTIC_PUBLISH:-8080}:8080"
environment:
# PORT moves both the server bind and the HEALTHCHECK together.
PORT: 8080
ACOUSTIC_DB_PATH: /data/acousticdna.sqlite3
ACOUSTIC_TEMP_DIR: /tmp
# YouTube blocks yt-dlp's default client from datacenter IPs (EC2, CI,
# cloud) with "not available on this app". android_vr authenticates AND
# serves downloadable audio without cookies. Override if YouTube shifts:
# YTDLP_EXTRA_ARGS='--extractor-args youtube:player_client=<client>' docker compose up
# Set YTDLP_EXTRA_ARGS= (empty) to use yt-dlp's default client, e.g. on
# non-datacenter hosts where android_vr formats now need a PO token (403).
YTDLP_EXTRA_ARGS: ${YTDLP_EXTRA_ARGS---extractor-args youtube:player_client=android_vr}
volumes:
# Named volume: the SQLite fingerprint DB persists across restarts.
- acousticdna-data:/data
# Read-only seed: entrypoint copies this into the volume above ONLY on
# first boot (empty volume). Requires `git lfs pull` locally, otherwise
# it's an LFS pointer and the entrypoint skips seeding (starts empty).
- ./acousticdna.sqlite3:/seed/acousticdna.sqlite3:ro
# Server writes transcode scratch WAVs here; keep it off the image layer.
# exec is required: the static yt-dlp binary self-extracts to /tmp and
# maps shared libs from there, which a default (noexec) tmpfs blocks.
tmpfs:
- /tmp:exec
restart: unless-stopped
volumes:
acousticdna-data: