-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (91 loc) · 3.06 KB
/
Copy pathdocker-compose.yml
File metadata and controls
97 lines (91 loc) · 3.06 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
name: click
services:
# S3-compatible object storage. Swap for real AWS S3 in production by
# dropping this service and clearing CLICK_S3_ENDPOINT (see README.md).
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000" # S3 API (the click CLI on the host talks to this)
- "9001:9001" # web console
volumes:
- minio-data:/data
restart: unless-stopped
# One-shot: create the bucket and allow anonymous reads so nginx can GET
# objects without signing requests (nginx never exposes the bucket itself —
# only paths under sites/<site>/).
minio-init:
image: minio/mc:latest
depends_on:
- minio
entrypoint: >
/bin/sh -c "
until mc alias set local http://minio:9000 minioadmin minioadmin; do sleep 1; done &&
mc mb --ignore-existing local/click-sites &&
mc anonymous set download local/click-sites &&
echo 'bucket click-sites ready'
"
# Per-site document database. Swap for RDS PostgreSQL in production by
# pointing CLICK_DATABASE_URL at it.
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: click
POSTGRES_PASSWORD: click
POSTGRES_DB: click
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U click -d click"]
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped
# Platform API server (identity, site listing, document DB, homepage).
clickd:
build: .
environment:
CLICK_S3_ENDPOINT: http://minio:9000
CLICK_BUCKET: click-sites
CLICK_DOMAIN: click.localhost:8080
CLICK_DATABASE_URL: postgres://click:click@postgres:5432/click?sslmode=disable
# Optional: enables POST /api/generate (AI site generation) locally by
# passing your own Anthropic credentials through; empty means disabled.
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
ANTHROPIC_AUTH_TOKEN: ${ANTHROPIC_AUTH_TOKEN:-}
CLICK_AI_MODEL: ${CLICK_AI_MODEL:-}
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
AWS_REGION: us-east-1
depends_on:
minio:
condition: service_started
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/healthz"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# Wildcard subdomain router: <site>.click.localhost:8080
nginx:
image: nginx:alpine
volumes:
- ./nginx/click.conf:/etc/nginx/conf.d/default.conf:ro
# Auth is off by default; docker-compose.auth.yml swaps in auth-on.conf
# plus the oauth2-proxy + dex services (`make up-auth`).
- ./nginx/auth-off.conf:/etc/nginx/click-auth.conf:ro
- ./nginx/security-headers.conf:/etc/nginx/security-headers.conf:ro
ports:
- "8080:80"
depends_on:
- minio
- clickd
restart: unless-stopped
volumes:
minio-data:
postgres-data: