-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-http.yaml
139 lines (132 loc) · 3.22 KB
/
docker-compose-http.yaml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
version: '3.3'
services:
frontend-reactjs:
image: skyface753/template-frontend
ports:
- '8080:80'
backend:
image: skyface753/template-backend
ports:
- 5000:5000
networks:
- crunchynet
volumes:
- avatars:/app/files/avatars/
environment:
- DB_HOST_PRIMARY=primary
- DB_HOST_REPLICA=primary
- DB_PORT_PRIMARY=5432
- DB_PORT_REPLICA=5432
- DB_USER=postgresUser
- DB_PASSWORD=postgresPassword
- DB_DATABASE=postgresDatabase
- JWT_SECRET=jwtSecret
- BCRYPT_ROUNDS=11
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=redisPassword
- FRONTEND_URL=http://localhost:8080
depends_on:
redis:
condition: service_healthy
primary:
condition: service_healthy
# - replica
primary:
image: postgres
environment:
- POSTGRES_USER=postgresUser
- POSTGRES_PASSWORD=postgresPassword
- POSTGRES_DB=postgresDatabase
volumes:
- pg-vol-neu4:/var/lib/postgresql/data
networks:
- crunchynet
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
# Crunchy Data arent persistent
# primary:
# image: crunchydata/crunchy-postgres:centos8-13.6-4.7.5
# environment:
# - PGHOST=/tmp
# - MAX_CONNECTIONS=10
# - MAX_WAL_SENDERS=5
# - PG_MODE=primary
# - MODE=postgres
# - PG_PRIMARY_USER=primaryuser
# - PG_PRIMARY_PASSWORD=password
# - PG_DATABASE=postgresDatabase
# - PG_USER=postgresUser
# - PG_PASSWORD=postgresPassword
# - PG_ROOT_PASSWORD=password
# - PG_PRIMARY_PORT=5432
# networks:
# - crunchynet
# deploy:
# placement:
# constraints:
# - node.labels.type == primary
# - node.role == worker
# volumes:
# - ./pgtest/data:/pgdata
# - ./pgtest/conf:/pgconf
# ports:
# - '5432'
# replica:
# image: crunchydata/crunchy-postgres:centos8-13.6-4.7.5
# environment:
# - PGHOST=/tmp
# - MAX_CONNECTIONS=10
# - MAX_WAL_SENDERS=5
# - PG_MODE=replica
# - MODE=postgres
# - PG_PRIMARY_HOST=primary
# - PG_PRIMARY_PORT=5432
# - PG_PRIMARY_USER=primaryuser
# - PG_PRIMARY_PASSWORD=password
# - PG_DATABASE=postgresDatabase
# - PG_USER=postgresUser
# - PG_PASSWORD=postgresPassword
# - PG_ROOT_PASSWORD=password
# networks:
# - crunchynet
# ports:
# - '5432'
# deploy:
# placement:
# constraints:
# - node.labels.type != primary
# - node.role == worker
# replicas: 2
# volumes:
# - replica-vol2:/pgdata
redis:
image: redis
networks:
- crunchynet
healthcheck:
test: ["CMD", "redis-cli","ping"]
pgadmin:
image: dpage/pgadmin4
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: root
ports:
- '5050:80'
networks:
- crunchynet
volumes:
- pgadmin-vol:/var/lib/pgadmin
networks:
crunchynet:
volumes:
primary-vol2:
replica-vol2:
avatars:
pg-vol-neu4:
pgadmin-vol: