-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
57 lines (56 loc) · 1.49 KB
/
docker-compose.yaml
File metadata and controls
57 lines (56 loc) · 1.49 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
services:
security_db:
container_name: security_db
ports: ["5432:5432"]
environment:
- POSTGRES_PASSWORD=postgres
image: postgres
volumes:
- ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- pgdata:/var/lib/postgresql/data
security_db_replica_one:
container_name: security_db_replica_one
ports: ["5433:5432"]
environment:
- POSTGRES_PASSWORD=postgres
image: postgres
volumes:
- ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
security_db_replica_two:
container_name: security_db_replica_two
ports: ["5434:5432"]
environment:
- POSTGRES_PASSWORD=postgres
image: postgres
volumes:
- ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
migrate_replica_one:
build: .
environment:
DATABASE_URL: postgresql://postgres:postgres@0.0.0.0:5433/postgres
SECRET_KEY: somesecret
network_mode: host
depends_on:
- security_db_replica_one
entrypoint: |
bash -c "
sleep 5
pip install -r requirements.txt
FLASK_APP=webapp.app flask db upgrade
"
migrate_replica_two:
build: .
environment:
DATABASE_URL: postgresql://postgres:postgres@0.0.0.0:5434/postgres
SECRET_KEY: somesecret
network_mode: host
depends_on:
- security_db_replica_two
entrypoint: |
bash -c "
sleep 5
pip install -r requirements.txt
FLASK_APP=webapp.app flask db upgrade
"
volumes:
pgdata: