Skip to content

Commit f0c8422

Browse files
authored
new docker compose (#76)
1 parent ea1b589 commit f0c8422

1 file changed

Lines changed: 119 additions & 54 deletions

File tree

Lines changed: 119 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,156 @@
1-
x-control-env: &control-env
2-
DATABASE_URL: postgres://pgdog_control:pgdog_control@postgres:5432/pgdog_control
3-
REDIS_URL: redis://redis:6379
4-
SESSION_KEY: xEouatJSd9RWX4GDZvIFwvWn7Nywv/jh0UkrwnGJdfL6CVsIyUyegVTQY66l7RUR6ZCamqiPHgVlW0HL8PZ+0A==
1+
x-pgdog: &pgdog
2+
image: ghcr.io/pgdogdev/pgdog-enterprise:v2026-05-28
3+
command: ["pgdog", "--config", "/etc/pgdog/pgdog.toml", "--users", "/etc/secrets/pgdog/users.toml"]
4+
mem_limit: 1g
5+
environment:
6+
PGPASSWORD: postgres
7+
healthcheck:
8+
test: ["CMD-SHELL", "psql -h 127.0.0.1 -p 6432 -U postgres -d postgres -tAc 'SELECT 1' || exit 1"]
9+
interval: 5s
10+
timeout: 5s
11+
retries: 5
12+
depends_on:
13+
postgres:
14+
condition: service_healthy
15+
control:
16+
condition: service_healthy
517

618
services:
719
postgres:
820
image: postgres:17
921
environment:
10-
POSTGRES_USER: pgdog_control
11-
POSTGRES_PASSWORD: pgdog_control
12-
POSTGRES_DB: pgdog_control
13-
volumes:
14-
- postgres_data:/var/lib/postgresql/data
22+
POSTGRES_USER: postgres
23+
POSTGRES_PASSWORD: postgres
24+
POSTGRES_DB: postgres
1525
healthcheck:
16-
test: ["CMD-SHELL", "pg_isready -U pgdog_control"]
26+
test: ["CMD-SHELL", "pg_isready -U postgres"]
1727
interval: 5s
1828
timeout: 5s
1929
retries: 5
2030

2131
redis:
2232
image: redis:7
23-
volumes:
24-
- redis_data:/data
25-
26-
migrate:
27-
image: ghcr.io/pgdogdev/pgdog-enterprise/control:a93701bd
28-
environment:
29-
<<: *control-env
30-
command: control migrate
31-
depends_on:
32-
postgres:
33-
condition: service_healthy
34-
35-
init:
36-
image: ghcr.io/pgdogdev/pgdog-enterprise/control:a93701bd
37-
environment:
38-
<<: *control-env
39-
command: control onboard --email demo@pgdog.dev --password demopass --token 644b527c-b9d6-4fb2-9861-703bad871ec0 --name Demo
40-
depends_on:
41-
migrate:
42-
condition: service_completed_successfully
4333

4434
control:
45-
image: ghcr.io/pgdogdev/pgdog-enterprise/control:a93701bd
35+
image: ghcr.io/pgdogdev/pgdog-enterprise/control:v2026-05-28
4636
ports:
4737
- "8099:8080"
4838
environment:
49-
<<: *control-env
50-
DATABASE_URL: postgres://pgdog_control:pgdog_control@pgdog:6432/pgdog_control
51-
FRONTEND_URL: http://localhost:8099
52-
RUST_LOG: info
39+
RUST_LOG: warn
40+
CONTROL_CONFIG: /etc/pgdog-control/control.toml
41+
configs:
42+
- source: control_config
43+
target: /etc/pgdog-control/control.toml
44+
healthcheck:
45+
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/healthz || exit 1"]
46+
interval: 5s
47+
timeout: 5s
48+
retries: 5
5349
depends_on:
54-
pgdog:
50+
redis:
5551
condition: service_started
5652

5753
pgdog:
58-
image: ghcr.io/pgdogdev/pgdog-enterprise:a93701bd
59-
command: ["pgdog", "--config", "/etc/pgdog/pgdog.toml", "--users", "/etc/secrets/pgdog/users.toml"]
60-
mem_limit: 1g
54+
<<: *pgdog
6155
ports:
6256
- "6432:6432"
63-
configs:
57+
configs: &pgdog_one_configs
6458
- source: pgdog_config
6559
target: /etc/pgdog/pgdog.toml
6660
- source: pgdog_users
6761
target: /etc/secrets/pgdog/users.toml
62+
63+
pgdog2:
64+
<<: *pgdog
65+
ports:
66+
- "6433:6432"
67+
configs: &pgdog_two_configs
68+
- source: pgdog_config2
69+
target: /etc/pgdog/pgdog.toml
70+
- source: pgdog_users
71+
target: /etc/secrets/pgdog/users.toml
72+
73+
pgdog3:
74+
<<: *pgdog
75+
configs: *pgdog_one_configs
76+
77+
pgdog4:
78+
<<: *pgdog
79+
configs: *pgdog_two_configs
80+
81+
pgbench:
82+
image: postgres:17
83+
environment:
84+
PGPORT: "6432"
85+
PGUSER: postgres
86+
PGPASSWORD: postgres
87+
PGDATABASE: postgres
88+
configs:
89+
- source: pgbench_script
90+
target: /scripts/pgbench.sql
91+
command:
92+
- bash
93+
- -c
94+
- |
95+
for host in pgdog pgdog2 pgdog3 pgdog4; do
96+
pgbench -h "$$host" -f /scripts/pgbench.sql -c 4 -t 1000000000 --no-vacuum &
97+
done
98+
wait
6899
depends_on:
69-
postgres:
100+
pgdog:
101+
condition: service_healthy
102+
pgdog2:
103+
condition: service_healthy
104+
pgdog3:
105+
condition: service_healthy
106+
pgdog4:
70107
condition: service_healthy
71-
init:
72-
condition: service_completed_successfully
73108

74109
configs:
110+
control_config:
111+
content: |
112+
[redis]
113+
url = "redis://redis:6379"
114+
75115
pgdog_config:
76116
content: |
77117
[general]
78118
port = 6432
79119
load_schema = "on"
80120
81121
[[databases]]
82-
name = "pgdog_control"
122+
name = "postgres"
83123
host = "postgres"
84124
port = 5432
85-
database_name = "pgdog_control"
86-
user = "pgdog_control"
87-
password = "pgdog_control"
88125
89126
[control]
90127
endpoint = "http://control:8080"
91-
token = "644b527c-b9d6-4fb2-9861-703bad871ec0"
128+
token = "pgdog-one"
129+
130+
[admin]
131+
user = "pgdog"
132+
password = "pgdog"
133+
134+
[query_stats]
135+
enabled = true
136+
137+
[qos]
138+
enabled = true
139+
140+
pgdog_config2:
141+
content: |
142+
[general]
143+
port = 6432
144+
load_schema = "on"
145+
146+
[[databases]]
147+
name = "postgres"
148+
host = "postgres"
149+
port = 5432
150+
151+
[control]
152+
endpoint = "http://control:8080"
153+
token = "pgdog-two"
92154
93155
[admin]
94156
user = "pgdog"
@@ -103,10 +165,13 @@ configs:
103165
pgdog_users:
104166
content: |
105167
[[users]]
106-
name = "pgdog_control"
107-
password = "pgdog_control"
108-
database = "pgdog_control"
168+
name = "postgres"
169+
password = "postgres"
170+
database = "postgres"
109171
110-
volumes:
111-
postgres_data:
112-
redis_data:
172+
pgbench_script:
173+
content: |
174+
SELECT 1;
175+
SELECT 2;
176+
SELECT pg_sleep(0.5);
177+
SELECT 1, 2, 3, pg_sleep(1);

0 commit comments

Comments
 (0)