Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
86 lines (81 loc) · 2.38 KB
/
Copy pathcompose.yaml
File metadata and controls
86 lines (81 loc) · 2.38 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
name: dank
services:
clickhouse:
image: clickhouse/clickhouse-server:25.8
environment:
# The database is reachable only on the Compose network.
CLICKHOUSE_SKIP_USER_SETUP: "1"
volumes:
- clickhouse_data:/var/lib/clickhouse
- ./schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro
healthcheck:
test: ["CMD", "clickhouse-client", "--query", "SELECT 1 FROM dank.web_embedding_cache LIMIT 0"]
interval: 5s
timeout: 5s
retries: 30
start_period: 30s
ulimits:
nofile:
soft: 262144
hard: 262144
restart: unless-stopped
postgres:
# Major versions change only by dump and restore; see docs/setup.md.
image: postgres:18
environment:
# These apply only to an empty volume and match the defaults in
# dank.config. The database is reachable only on the Compose network.
POSTGRES_DB: dank
POSTGRES_USER: dank
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
secrets:
- postgres_password
volumes:
# Postgres 18+ images keep their data in 18/docker beneath this directory.
- postgres_data:/var/lib/postgresql
healthcheck:
# TCP, because the image's temporary init server answers only on a socket.
test: ["CMD", "pg_isready", "--host=127.0.0.1", "--username=dank", "--dbname=dank"]
interval: 5s
timeout: 5s
retries: 30
start_period: 30s
restart: unless-stopped
dank:
build: .
depends_on:
clickhouse:
condition: service_healthy
postgres:
condition: service_healthy
secrets:
- postgres_password
ports:
- "127.0.0.1:8080:8080"
volumes:
- type: bind
source: ./config.toml
target: /run/dank/config.toml
read_only: true
bind:
create_host_path: false
- dank_data:/app/data
- model_cache:/home/dank/.cache
shm_size: 1gb
# Allow reader collection workers to close owned browser sessions.
stop_grace_period: 110s
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/', timeout=5).close()"]
interval: 10s
timeout: 10s
retries: 12
start_period: 30s
restart: unless-stopped
secrets:
postgres_password:
file: ./postgres-password
volumes:
clickhouse_data:
postgres_data:
dank_data:
model_cache: