-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
90 lines (84 loc) · 2.89 KB
/
docker-compose.yml
File metadata and controls
90 lines (84 loc) · 2.89 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
version: '3.9'
services:
primary-db:
image: postgres:16
container_name: primary-db
environment:
POSTGRES_DB: strongdatabase_primary
POSTGRES_USER: primary_user
POSTGRES_PASSWORD: primary_pass
ports:
- '5433:5432'
volumes:
- ./scripts/create_primary.sql:/docker-entrypoint-initdb.d/create_primary.sql:ro
- ./docker/primary/postgresql.conf:/etc/postgresql/postgresql.conf:ro
- ./docker/primary/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro
networks:
- strongdatabase_net
standby-db:
image: postgres:16
container_name: standby-db
environment:
POSTGRES_DB: strongdatabase_standby
POSTGRES_USER: standby_user
POSTGRES_PASSWORD: standby_pass
ports:
- '5434:5432'
entrypoint: ["/docker-entrypoint-initdb.d/standby-entrypoint.sh"]
volumes:
- ./scripts/create_standby.sql:/docker-entrypoint-initdb.d/create_standby.sql:ro
- ./docker/standby/postgresql.conf:/etc/postgresql/postgresql.conf:ro
- ./docker/standby/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro
- ./docker/standby/standby-entrypoint.sh:/docker-entrypoint-initdb.d/standby-entrypoint.sh:ro
networks:
- strongdatabase_net
replica1-db:
image: postgres:16
container_name: replica1-db
environment:
POSTGRES_DB: strongdatabase_replica1
POSTGRES_USER: replica1_user
POSTGRES_PASSWORD: replica1_pass
ports:
- '5435:5432'
entrypoint: ["/docker-entrypoint-initdb.d/replica-entrypoint.sh"]
volumes:
- ./scripts/create_replica1.sql:/docker-entrypoint-initdb.d/create_replica1.sql:ro
- ./docker/replica1/postgresql.conf:/etc/postgresql/postgresql.conf:ro
- ./docker/replica1/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro
- ./docker/replica1/replica-entrypoint.sh:/docker-entrypoint-initdb.d/replica-entrypoint.sh:ro
networks:
- strongdatabase_net
replica2-db:
image: postgres:16
container_name: replica2-db
environment:
POSTGRES_DB: strongdatabase_replica2
POSTGRES_USER: replica2_user
POSTGRES_PASSWORD: replica2_pass
ports:
- '5436:5432'
entrypoint: ["/docker-entrypoint-initdb.d/replica-entrypoint.sh"]
volumes:
- ./scripts/create_replica2.sql:/docker-entrypoint-initdb.d/create_replica2.sql:ro
- ./docker/replica2/postgresql.conf:/etc/postgresql/postgresql.conf:ro
- ./docker/replica2/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro
- ./docker/replica2/replica-entrypoint.sh:/docker-entrypoint-initdb.d/replica-entrypoint.sh:ro
networks:
- strongdatabase_net
api:
build:
context: .
dockerfile: StrongDatabase.Api/Dockerfile
container_name: strongdatabase-api
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
- "5000:80"
depends_on:
- primary-db
networks:
- strongdatabase_net
networks:
strongdatabase_net:
driver: bridge