Files
app-catalog-felhom.eu/templates/komga/docker-compose.yml
T
admin c99070c105 komga + audiobookshelf: add no-new-privileges (root-fallback hardening)
Address security review: reverting to root removed the user:1000 boundary, so add
security_opt no-new-privileges:true to block SUID-based escalation. Full cap_drop
is intentionally NOT applied — the images' root-init needs CHOWN/SETUID/SETGID to
set up /config and /metadata (dropping them reproduces the crash we hit at user:1000).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 22:17:32 +02:00

58 lines
2.1 KiB
YAML

# Komga - Képregény és manga szerver OPDS támogatással
# Domain: ${SUBDOMAIN}.${DOMAIN}
# Database: None (file-based)
# RAM: ~200M (mem_limit: 512M) | Pi-compatible: Yes
#
# Environment variables:
# DOMAIN - Your domain (e.g., demo-felhom.eu)
# USERDATA_PATH - Ügyfél-tartalom gyökér (<namespace>/userdata)
#
# Storage layout (felhom userdata convention):
# Képregénytár → ${USERDATA_PATH}/media/comics (írható)
# Run-identity: ROOT (fallback). user "1000:1000" was tried but the gotson/komga image creates its
# SQLite /config DB as root at init and cannot open it when pinned to 1000 (no PUID-style chown) —
# the container crash-loops. So it runs as root and relies on the setgid 2775 userdata dirs: files it
# writes land group 1000 so FileBrowser + group members can READ/browse them. (Verified live; see REPORT.)
services:
komga:
image: gotson/komga:1.20.0
container_name: komga
restart: unless-stopped
# Runs as root (see note above). Restore an escalation boundary: block SUID-based privilege
# escalation. Full cap_drop is NOT applied — the image's root-init needs CHOWN/SETUID/SETGID to
# set up /config, and dropping them crash-loops it (the same failure we hit pinning user:1000).
security_opt:
- no-new-privileges:true
environment:
- TZ=Europe/Budapest
volumes:
- komga_config:/config
- ${USERDATA_PATH}/media/comics:/data
networks:
- traefik-public
deploy:
resources:
limits:
memory: 512M
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:25600/api/v1/actuator/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
labels:
- "traefik.enable=true"
- "traefik.http.routers.komga.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)"
- "traefik.http.routers.komga.entrypoints=websecure"
- "traefik.http.routers.komga.tls=true"
- "traefik.http.routers.komga.tls.certresolver=letsencrypt"
- "traefik.http.services.komga.loadbalancer.server.port=25600"
volumes:
komga_config:
networks:
traefik-public:
external: true