-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·83 lines (78 loc) · 1.87 KB
/
Copy pathdocker-compose.yml
File metadata and controls
executable file
·83 lines (78 loc) · 1.87 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
version: '3'
# Microservices
services:
# Postgresql database container
db:
image: postgres:latest
container_name: stocks-postgres
privileged: true
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=123456
- POSTGRES_DB=stocks
volumes:
- ./db/db.sql:/docker-entrypoint-initdb.d/db.sql
networks:
- stocks-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -h stocks-postgres -U postgres -p 5432 | grep 'accepting connections'"]
interval: 10s
timeout: 10s
retries: 10
start_period: 30s
pgbouncer:
build: ./pgbouncer
container_name: pgbouncer
image: bitnami/pgbouncer:latest
environment:
- AUTH_TYPE=trust
- POOL_MODE=session
- PGBOUNCER_MAX_CLIENT_CONN=100
- PGBOUNCER_DEFAULT_POOL_SIZE=20
- POSTGRESQL_HOST=postgres
- POSTGRESQL_USER=postgres
- POSTGRESQL_PASSWORD=123456
volumes:
- ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini
- ./pgbouncer/userlist.txt:/etc/pgbouncer/userlist.txt
ports:
- 6432:6432
networks:
- stocks-network
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "pg_isready -h db -p 5432 -U postgres"]
interval: 10s
timeout: 10s
retries: 5
# Core container
core:
build: ./src
container_name: core-modules
ports:
- 5000:5000
volumes:
- ./src:/usr/workspace
networks:
- stocks-network
depends_on:
pgbouncer:
condition: service_healthy
# Streamlit app container
web:
build: ./streamlit
container_name: streamlit-container
ports:
- 8501:8501
volumes:
- ./streamlit:/app
networks:
- stocks-network
depends_on:
- core
# Shared network for microservices
networks:
stocks-network:
name: stocks-network