-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
99 lines (93 loc) · 2.72 KB
/
Copy pathdocker-compose.yml
File metadata and controls
99 lines (93 loc) · 2.72 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
# pgEdge AI DBA Workbench - Docker Compose
#
# Before starting, generate the shared secret and password files:
#
# mkdir -p docker/secret
# openssl rand -base64 32 > docker/secret/ai-dba.secret
# echo "postgres" > docker/secret/pg-password
# export POSTGRES_PASSWORD=postgres
#
# Then start all services:
#
# docker compose up -d
#
services:
postgres:
image: ghcr.io/pgedge/pgedge-postgres:18-spock5-standard
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}
POSTGRES_DB: ai_workbench
command: ["postgres", "-c", "listen_addresses=*"]
volumes:
- pgdata:/var/lib/pgsql/18/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
ports:
- "${POSTGRES_PORT:-5432}:5432"
collector:
build:
context: .
dockerfile: collector/Dockerfile
depends_on:
postgres:
condition: service_healthy
volumes:
- ./docker/config/ai-dba-collector.yaml:/etc/pgedge/ai-dba-collector.yaml:ro
- ./docker/secret/ai-dba.secret:/etc/pgedge/ai-dba.secret:ro
- ./docker/secret/pg-password:/etc/pgedge/pg-password:ro
# Run an init process as PID 1 for robust signal forwarding and
# zombie reaping.
init: true
# Give the collector time to close its connection pools during its
# multi-step graceful shutdown before the container is killed.
stop_grace_period: 30s
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
server:
build:
context: .
dockerfile: server/Dockerfile
depends_on:
postgres:
condition: service_healthy
volumes:
- ./docker/config/ai-dba-server.yaml:/etc/pgedge/ai-dba-server.yaml:ro
- ./docker/secret/ai-dba.secret:/etc/pgedge/ai-dba.secret:ro
- server-data:/data
ports:
- "${SERVER_PORT:-8080}:8080"
restart: unless-stopped
alerter:
build:
context: .
dockerfile: alerter/Dockerfile
depends_on:
postgres:
condition: service_healthy
volumes:
- ./docker/config/ai-dba-alerter.yaml:/etc/pgedge/ai-dba-alerter.yaml:ro
- ./docker/secret/ai-dba.secret:/etc/pgedge/ai-dba.secret:ro
- ./docker/secret/pg-password:/etc/pgedge/pg-password:ro
restart: unless-stopped
client:
build:
context: .
dockerfile: client/Dockerfile
depends_on:
- server
ports:
# The client image runs nginx as a non-root user listening on
# the unprivileged port 8080. CLIENT_PORT is the host-side
# port and stays at 3000 by default.
- "${CLIENT_PORT:-3000}:8080"
restart: unless-stopped
volumes:
pgdata:
server-data: