-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
54 lines (53 loc) · 1.91 KB
/
docker-compose.yml
File metadata and controls
54 lines (53 loc) · 1.91 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
services:
backend:
image: ghcr.io/pttcodingman/justwiki/backend:main
build:
context: .
dockerfile: backend/Dockerfile
volumes:
- ./data:/app/data
env_file:
- path: .env
required: false
# Override the dev-oriented defaults so the container reads/writes the
# mounted /app/data volume and treats the frontend nginx (port 3000) as
# the public ingress — OIDC redirect_uri must round-trip through nginx.
# TRUST_PROXY=true because nginx is the only reachable peer.
#
# PUBLIC_BASE_URL: hardcode the docker-correct value rather than
# `${PUBLIC_BASE_URL:-...}`, because the shipped .env.example sets the
# dev value (localhost:8000) and `:-default` only fires when unset, not
# when set-to-something. To override for prod, set PUBLIC_BASE_URL_DOCKER
# in your .env (e.g., https://wiki.example.com).
environment:
DATA_DIR: /app/data
DB_PATH: /app/data/just-wiki.db
MEDIA_DIR: /app/data/media
PUBLIC_BASE_URL: ${PUBLIC_BASE_URL_DOCKER:-http://localhost:3000}
TRUST_PROXY: "true"
# Block-style list: docker-compose's flow-sequence parser whitespace-
# splits long quoted strings into separate argv tokens. Each arg on its
# own line dodges that. The Python expression must stay single-statement
# for the same reason — `;` would be split too if it ever reverts.
healthcheck:
test:
- CMD
- python
- -c
- "__import__('urllib.request',fromlist=['request']).urlopen('http://localhost:8000/api/health',timeout=3).read()"
interval: 30s
timeout: 5s
start_period: 15s
retries: 3
restart: unless-stopped
frontend:
image: ghcr.io/pttcodingman/justwiki/frontend:main
build:
context: .
dockerfile: frontend/Dockerfile
ports:
- "3000:3000"
depends_on:
backend:
condition: service_healthy
restart: unless-stopped