-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (86 loc) · 2.25 KB
/
Copy pathdocker-compose.yml
File metadata and controls
92 lines (86 loc) · 2.25 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
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- '${APP_PORT:-3000}:3000'
environment:
DATABASE_URL: postgresql://propchain:${POSTGRES_PASSWORD:-propchain}@pgbouncer:6432/propchain?pgbouncer=true
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
CACHE_WARMING_ENABLED: 'true'
depends_on:
postgres:
condition: service_healthy
pgbouncer:
condition: service_healthy
redis:
condition: service_healthy
networks:
- propchain
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: propchain
POSTGRES_USER: propchain
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-propchain}
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- '${POSTGRES_PORT:-5432}:5432'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U propchain']
interval: 5s
timeout: 5s
retries: 5
networks:
- propchain
pgbouncer:
image: edoburu/pgbouncer:1.23.1
environment:
DATABASE_URL: postgresql://propchain:${POSTGRES_PASSWORD:-propchain}@postgres:5432/propchain
POOL_MODE: transaction
DEFAULT_POOL_SIZE: ${PGBOUNCER_POOL_SIZE:-20}
MIN_POOL_SIZE: ${PGBOUNCER_MIN_POOL_SIZE:-5}
MAX_DB_CONNECTIONS: ${PGBOUNCER_MAX_DB_CONNECTIONS:-40}
MAX_USER_CONNECTIONS: ${PGBOUNCER_MAX_USER_CONNECTIONS:-40}
SERVER_IDLE_TIMEOUT: '300'
CLIENT_IDLE_TIMEOUT: '0'
LOG_CONNECTIONS: 1
LOG_DISCONNECTIONS: 1
LOG_POOLER_ERRORS: 1
ports:
- '${PGBOUNCER_PORT:-6432}:6432'
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ['CMD-SHELL', 'pg_isready -h localhost -p 6432']
interval: 5s
timeout: 5s
retries: 5
networks:
- propchain
redis:
image: redis:7-alpine
ports:
- '${REDIS_PORT:-6379}:6379'
command: redis-server --appendonly yes ${REDIS_PASSWORD:+--requirepass ${REDIS_PASSWORD}}
volumes:
- redisdata:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 5s
retries: 5
networks:
- propchain
volumes:
pgdata:
redisdata:
networks:
propchain:
driver: bridge