-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
65 lines (63 loc) · 1.69 KB
/
docker-compose.yml
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
services:
db:
image: postgres:16.3
restart: unless-stopped
volumes:
- db_data:/var/lib/postgresql/data
- db_socket:/var/run/postgresql
ports:
- 5432:5432
command: postgres -c shared_preload_libraries=pg_stat_statements -c log_lock_waits=on
environment:
POSTGRES_PASSWORD: ${ADMIN_DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
api:
image: "postgrest/postgrest:v12.0.3"
ports:
- 3000:3000
environment:
PGRST_DB_URI: postgres://${DB_USER}:${DB_PASSWORD}@/${DB_NAME}?host=/var/run/postgresql
PGRST_DB_SCHEMAS: "api, worker"
PGRST_DB_ANON_ROLE: "anonymous"
depends_on:
db:
condition: service_healthy
volumes:
- db_socket:/var/run/postgresql
worker:
build:
context: .
dockerfile: ./docker/worker.Dockerfile
privileged: false
restart: unless-stopped
environment:
- DATABASE_URL=${DATABASE_URL}
- WORKERS_PER_INSTANCE=${WORKERS_PER_INSTANCE}
depends_on:
db:
condition: service_healthy
db_bench:
image: postgres:16.3
restart: unless-stopped
volumes:
- db_data:/var/lib/postgresql/data
- ./benchmark/db_socket:/var/run/postgresql
ports:
- 5432:5432
command: postgres -c shared_preload_libraries=pg_stat_statements -c log_lock_waits=on
environment:
POSTGRES_PASSWORD: ${ADMIN_DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
db_data: null
db_socket: null