Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
124 lines (119 loc) · 4.56 KB
/
Copy pathdocker-compose.yml
File metadata and controls
124 lines (119 loc) · 4.56 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Local compose stack — `docker compose up` brings up the server, the
# client (nginx), and a MinIO object store. Captured frames and GIFs are
# uploaded to MinIO and served directly from it; nginx only proxies
# /screenshots (API + SSE), /health, /docs, /metrics.
services:
minio:
image: minio/minio:RELEASE.2025-01-20T14-49-07Z
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
# 9000: S3 API (also the URL the browser uses to fetch images).
# 9011 → 9001: MinIO web console. Remapped on the host because 9001
# is commonly taken by other local dev processes.
- "9000:9000"
- "9011:9001"
volumes:
- minio-data:/data
healthcheck:
test: ["CMD", "curl", "-fs", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
# One-shot bucket bootstrap: waits for MinIO, creates the bucket if
# missing, and makes it publicly readable so the browser can load
# captured images with a plain <img src>.
minio-init:
image: minio/mc:RELEASE.2025-01-17T23-25-50Z
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 minioadmin minioadmin &&
mc mb --ignore-existing local/webrewind &&
mc anonymous set download local/webrewind &&
echo 'bucket ready'
"
restart: "no"
server:
build:
context: .
dockerfile: apps/server/Dockerfile
environment:
# CLIENT_ORIGIN matches the nginx-exposed client port; the server's
# CORS middleware reads this. Not strictly needed when the client
# proxies to the server (same-origin), but defensive for direct hits.
CLIENT_ORIGIN: http://localhost:8080
# PUBLIC_BASE_URL is the URL the CLIENT sees the server at. Used
# for /screenshots and /screenshots/events/<id> streamUrl — NOT for
# image URLs (those go direct to MinIO via MINIO_PUBLIC_URL).
PUBLIC_BASE_URL: http://localhost:8080
TRUST_PROXY: "true"
# Internal endpoint the server uses to PUT/DELETE objects.
MINIO_ENDPOINT: http://minio:9000
# External endpoint the browser uses to GET images. On a real
# deployment this becomes https://objects.example.com.
MINIO_PUBLIC_URL: http://localhost:9000
MINIO_BUCKET: webrewind
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
# DEV ONLY — disables TLS cert verification on the Wayback axios
# client. Needed on networks with SSL inspection (corporate proxy /
# Zscaler). Remove this line on Oracle Cloud / any public-internet
# deployment, where cert chains are clean.
INSECURE_TLS: "true"
# AI captions. Pulled from the repo-root .env (gitignored) via
# compose variable interpolation — keeps the secret out of source.
# Empty → /summaries returns 503 and the feature is effectively off.
NVIDIA_API_KEY: ${NVIDIA_API_KEY:-}
SUMMARY_MODEL: ${SUMMARY_MODEL:-google/gemma-3n-e4b-it}
depends_on:
minio-init:
condition: service_completed_successfully
expose:
- "3200"
ports:
# Expose server directly for debugging; remove in production.
# 3201 on the host so a locally-running dev server on 3200 doesn't
# clash. Inside the compose network nginx still hits server:3200.
- "3201:3200"
restart: unless-stopped
# Chromium sandbox requires either --no-sandbox (which we pass in the
# launch args) or kernel capabilities granted via docker. Using
# --no-sandbox is fine inside an already-isolated container.
# Increase /dev/shm — Chromium writes rendering caches here and the
# 64 MB default is easy to exhaust on heavier pages.
shm_size: 1gb
healthcheck:
test:
[
"CMD",
"node",
"-e",
"require('http').get('http://localhost:3200/health', r => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
client:
build:
context: .
dockerfile: apps/client/Dockerfile
args:
# Empty — lets the SPA use same-origin /screenshots etc, which
# nginx (inside this container) proxies to the server service.
VITE_API_BASE_URL: ""
ports:
- "8080:80"
depends_on:
server:
condition: service_healthy
restart: unless-stopped
volumes:
minio-data: