-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
83 lines (80 loc) 路 2.22 KB
/
Copy pathdocker-compose.yml
File metadata and controls
83 lines (80 loc) 路 2.22 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
services:
postgres:
image: postgres:16-alpine
shm_size: 128mb
command:
- postgres
- -c
- shared_buffers=${POSTGRES_SHARED_BUFFERS:-256MB}
- -c
- effective_cache_size=${POSTGRES_EFFECTIVE_CACHE_SIZE:-768MB}
- -c
- maintenance_work_mem=${POSTGRES_MAINTENANCE_WORK_MEM:-128MB}
- -c
- wal_compression=${POSTGRES_WAL_COMPRESSION:-on}
- -c
- random_page_cost=${POSTGRES_RANDOM_PAGE_COST:-1.1}
environment:
POSTGRES_DB: ${POSTGRES_DB:-pr_agent}
POSTGRES_USER: ${POSTGRES_USER:-pr_agent}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pr_agent}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-pr_agent} -d ${POSTGRES_DB:-pr_agent}"]
interval: 5s
timeout: 5s
retries: 10
pr-agent-web:
build: .
image: pr-agent:local
env_file:
- ${PR_AGENT_ENV_FILE:-.env}
environment:
ROLE: "web"
PORT: "7224"
DATABASE_URL: "postgres://${POSTGRES_USER:-pr_agent}:${POSTGRES_PASSWORD:-pr_agent}@postgres:5432/${POSTGRES_DB:-pr_agent}"
ports:
- "7224:7224"
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:7224/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
pr-agent-worker:
build: .
image: pr-agent:local
env_file:
- ${PR_AGENT_ENV_FILE:-.env}
environment:
ROLE: "worker"
DATABASE_URL: "postgres://${POSTGRES_USER:-pr_agent}:${POSTGRES_PASSWORD:-pr_agent}@postgres:5432/${POSTGRES_DB:-pr_agent}"
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:'+(process.env.PORT||7224)+'/ready').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
volumes:
postgres-data: