Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
68 lines (66 loc) · 3.04 KB
/
Copy pathcompose.yml
File metadata and controls
68 lines (66 loc) · 3.04 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: docshot
services:
docshot:
# Gotenberg + docshot in one container; network isolation uses Gotenberg's --*-deny-*-ips flags (see Dockerfile CMD).
build:
context: .
args:
# make up stamps VERSION; a plain docker compose build stamps dev.
VERSION: ${DOCSHOT_VERSION:-dev}
GOTENBERG_VERSION: "8.37"
image: docshot:${DOCSHOT_VERSION:-dev}
container_name: docshot
restart: unless-stopped
# Drain requests (30s), then let Gotenberg stop (up to 20s) before Docker kills the container.
stop_grace_period: 60s
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
ports:
- "9994:3000"
environment:
- DOCSHOT_DEFAULT_DPI=${DOCSHOT_DEFAULT_DPI:-150}
- DOCSHOT_DEFAULT_WIDTH=${DOCSHOT_DEFAULT_WIDTH:-0}
- DOCSHOT_DEFAULT_HEIGHT=${DOCSHOT_DEFAULT_HEIGHT:-0}
- DOCSHOT_MAX_SIDE=${DOCSHOT_MAX_SIDE:-10000}
- DOCSHOT_MAX_PIXELS=${DOCSHOT_MAX_PIXELS:-40000000}
- DOCSHOT_MAX_BYTES=${DOCSHOT_MAX_BYTES:-100MB}
- DOCSHOT_TIMEOUT_SECONDS=${DOCSHOT_TIMEOUT_SECONDS:-180}
# Uploads held in memory at once; beyond it requests wait, then 429. Keep well under the memory limit.
- DOCSHOT_UPLOAD_MEMORY=${DOCSHOT_UPLOAD_MEMORY:-1GB}
- DOCSHOT_LOG_FORMAT=${DOCSHOT_LOG_FORMAT:-text}
- DOCSHOT_PDFIUM_WORKERS=${DOCSHOT_PDFIUM_WORKERS:-4}
- DOCSHOT_CACHE_MB=${DOCSHOT_CACHE_MB:-256}
- DOCSHOT_MAX_AGE=${DOCSHOT_MAX_AGE:-3600}
# Disk cache of rendered results, keyed by URL: a hit costs no S3/file access. See README → Caching.
- DOCSHOT_CACHE_DIR=${DOCSHOT_CACHE_DIR:-/tmp/docshot}
- DOCSHOT_CACHE_SIZE=${DOCSHOT_CACHE_SIZE:-10GB}
- DOCSHOT_CACHE_TTL=${DOCSHOT_CACHE_TTL:-0}
- DOCSHOT_CACHE_STALE=${DOCSHOT_CACHE_STALE:-true}
- DOCSHOT_CACHE_BUSTER=${DOCSHOT_CACHE_BUSTER:-}
- DOCSHOT_CACHE_TAGS=${DOCSHOT_CACHE_TAGS:-false}
- DOCSHOT_CDN_MAX_AGE=${DOCSHOT_CDN_MAX_AGE:-0}
# GET /render sources for <img src=…> previews — all off unless set.
# ?s3=bucket/key as a source, and ?store=s3[:append|replace|suffix|hash]
# to keep results in S3 (next to an S3 source; else in DOCSHOT_STORE_BUCKET).
- DOCSHOT_S3_ENDPOINT=${DOCSHOT_S3_ENDPOINT:-}
- DOCSHOT_S3_ACCESS_KEY=${DOCSHOT_S3_ACCESS_KEY:-}
- DOCSHOT_S3_SECRET_KEY=${DOCSHOT_S3_SECRET_KEY:-}
- DOCSHOT_S3_REGION=${DOCSHOT_S3_REGION:-}
- DOCSHOT_S3_SSL=${DOCSHOT_S3_SSL:-true}
- DOCSHOT_S3_BUCKETS=${DOCSHOT_S3_BUCKETS:-}
- DOCSHOT_STORE_BUCKET=${DOCSHOT_STORE_BUCKET:-}
- DOCSHOT_STORE_PREFIX=${DOCSHOT_STORE_PREFIX:-docshot/}
- DOCSHOT_STORE_STRATEGY=${DOCSHOT_STORE_STRATEGY:-append}
# ?url= : regexp of URLs allowed to be fetched (SSRF guard). Empty = off.
- DOCSHOT_FETCH_ALLOW=${DOCSHOT_FETCH_ALLOW:-}
- TZ=${TZ:-UTC}
volumes:
- docshot-cache:/tmp/docshot # disk cache survives restarts and upgrades
deploy:
resources:
limits:
cpus: "${DOCSHOT_CPUS:-4.0}"
memory: ${DOCSHOT_MEMORY:-4g}
volumes:
docshot-cache: