-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (49 loc) · 1.28 KB
/
docker-compose.yml
File metadata and controls
51 lines (49 loc) · 1.28 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
services:
api:
build: .
image: notes-api
container_name: notes-api
entrypoint: [ "bash", "-c", "./k8s/scripts/migrate-db.sh && ./k8s/scripts/api.sh" ]
volumes:
- venv:/app/.venv
- .:/app
ports:
- 8022:8022
environment:
# - ENV=app-runner
- DATABASE_HOST=db-pool
- DATABASE_PORT=5499
- DATABASE_URL=postgresql://postgres:postgres@db-pool:5499/notes_db
- DATABASE_URL_TEST=postgresql://postgres:postgres@db:5432/notes_db_test
db:
image: postgres:12
container_name: notes-db
volumes:
- notes_db_data:/var/lib/postgresql/data/
- ./scripts/pg_init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=notes_db
ports:
- "5434:5432"
# psql postgres://postgres:postgres@127.0.0.1:5499/pgbouncer
pgbouncer:
container_name: db-pool
image: edoburu/pgbouncer
environment:
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_HOST=notes-db
- DB_NAME=notes_db
- POOL_MODE=session
- ADMIN_USERS=postgres
- LISTEN_PORT=5499
- VERBOSE=0
- DEFAULT_POOL_SIZE=300
- MAX_CLIENT_CONN=10000
ports:
- "5432:5499"
volumes:
notes_db_data:
venv: