-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdocker-compose.yml
184 lines (167 loc) · 4.08 KB
/
docker-compose.yml
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# Kanvas is a distributed system with multiple databases, servers, and web browser clients
# For development, we can spin everything up with a docker-compose setup
services:
store-db:
image: postgres:13
command:
- postgres
- -c
- wal_level=logical # <- required for logical replication
ports:
- 54320:5432
environment:
POSTGRES_USER: store_pguser
POSTGRES_PASSWORD: store_pgpass
POSTGRES_DB: dev_database
restart: on-failure
store-api:
build:
context: .
dockerfile: ./store-api-server/Dockerfile
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 3005:3000
links:
- store-db
- store-quepasa
environment:
PGHOST: store-db
PGPORT: 5432
PGUSER: store_pguser
PGPASSWORD: store_pgpass
PGDATABASE: dev_database
KANVAS_API_PORT: 3000
env_file:
- store-api-server/.env
entrypoint: |-
bash -c '
set -e
if [ "${STORE_API_ENABLED:-yes}" == "no" ]; then
exit 0
fi
./script/entrypoint
'
restart: on-failure
store-front:
build:
context: .
dockerfile: ./store-front/Dockerfile
ports:
- 3000:3000
environment:
REACT_APP_PORT: 3000
env_file:
- store-front/.env
entrypoint: |-
bash -c '
set -e
if [ "${STORE_FRONT_ENABLED:-yes}" == "no" ]; then
exit 0
fi
yarn start:prod
'
restart: on-failure
store-quepasa:
image: ghcr.io/tzconnectberlin/que-pasa:1.2.6
volumes:
- ./config:/config
environment:
PGHOST: store-db
PGPORT: 5432
PGUSER: store_pguser
PGPASSWORD: store_pgpass
PGDATABASE: dev_database
DATABASE_URL: "postgres://store_pguser:store_pgpass@store-db:5432/dev_database"
CONTRACT_SETTINGS: /config/kanvas.yaml
links:
- store-db
env_file:
- config/.env-kanvas
command:
- --bcd-enable
restart: on-failure
peppermint:
image: ghcr.io/tzconnectberlin/peppermint:1.2
volumes:
- ./config:/config
links:
- store-db
entrypoint: |-
bash -c '
set -e
psql -d "$$DATABASE_URL" < database/schema.sql
if [ "${PEPPERMINT_ENABLED:-yes}" == "no" ]; then
exit 0
fi
cp /config/peppermint.json config.json
node app.mjs
'
environment:
DATABASE_URL: "postgres://store_pguser:store_pgpass@store-db:5432/dev_database"
restart: on-failure
admin-db:
image: postgres:13
ports:
- 54321:5432
environment:
POSTGRES_USER: admin_pguser
POSTGRES_PASSWORD: admin_pgpass
POSTGRES_DB: dev_database
restart: on-failure
admin-api:
build:
context: .
dockerfile: ./admin-api-server/Dockerfile
entrypoint: |-
bash -c '
set -e
if [ "${ADMIN_API_ENABLED:-yes}" == "no" ]; then
exit 0
fi
./script/entrypoint
'
ports:
- 3006:3001
links:
- admin-db
- store-db
- store-api
env_file:
- admin-api-server/.env
environment:
POSTGRES_USER: admin_pguser
POSTGRES_PASSWORD: admin_pgpass
POSTGRES_DB: dev_database
PGHOST: admin-db
PGPORT: 5432
PGUSER: admin_pguser
PGPASSWORD: admin_pgpass
PGDATABASE: dev_database
STORE_PGHOST: store-db
STORE_PGPORT: 5432
STORE_PGUSER: store_pguser
STORE_PGPASSWORD: store_pgpass
STORE_PGDATABASE: dev_database
ADMIN_API_PORT: 3001
STORE_API: http://store-api:3000
restart: on-failure
admin-front:
build:
context: .
dockerfile: ./admin-front/Dockerfile
args:
REACT_APP_API_SERVER_BASE_URL: http://localhost:3006
REACT_APP_STORE_BASE_URL: http://localhost:3000
REACT_APP_STORE_API_URL: http://localhost:3005
ports:
- 5050:80
entrypoint: |-
sh -c '
set -e
if [ "${STORE_FRONT_ENABLED:-yes}" == "no" ]; then
exit 0
fi
nginx -g "daemon off;"
'
restart: on-failure