-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
231 lines (208 loc) · 7.07 KB
/
Copy pathdocker-compose.yml
File metadata and controls
231 lines (208 loc) · 7.07 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
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# TODO: the actual usernames/passwords shouldn't be stored in this file. We need
# a way to put those somewhere that's not in version control.
#
# Environment variables come from .env
# https://docs.docker.com/compose/compose-file/#variable-substitution
#
# Use docker-compose file version 3
version: "3"
services:
# Database service
postgres:
# Build a custom image with pg_cron
build: ./db
image: postgres_cron
# Use a custom config file for postgres to include pg_cron
command:
- "postgres"
- "-c"
- "config_file=/etc/postgresql/postgresql.conf"
container_name: "${POSTGRES_HOST}"
env_file:
- .env
# Forward ports, format 'container:host'
ports:
- ${POSTGRES_PORT}:${POSTGRES_PORT}
# Mount local directories on the container filesystem
volumes:
# A place to store postgres data
- ./db/db-data:/var/lib/postgresql
# Script to initialize a test database
- ./db/init/schema.sql:/docker-entrypoint-initdb.d/schema.sql
restart: unless-stopped
# Pgadmin service (web interface)
pgadmin:
image: "dpage/pgadmin4"
# Can't have the web interface without a database
depends_on:
- postgres
container_name: "${PGADMIN_HOST}"
env_file:
- .env
volumes:
- ./db/pgadmin:/var/lib/pgadmin
ports:
- "${PGADMIN_PORT}:80"
restart: unless-stopped
inventory-management:
build: ./inventory-management
container_name: "${INVENTORY_HOST}"
env_file:
- .env
# Forward ports, format 'container:host'
ports:
- ${INVENTORY_PORT}:${INVENTORY_PORT}
# Mount local directories on the container filesystem.
# Should not happen in production.
volumes:
- ./inventory-management/src:/usr/app/src
- ./inventory-management/app.js:/usr/app/app.js
- ./inventory-management/process.json:/usr/app/process.json
- ./inventory-management/registrations.js:/usr/app/registrations.js
- ./inventory-management/.inventory-managementrc:/usr/app/.inventory-managementrc
- ./inventory-management/log:/usr/app/log
- ./inventory-management/tests:/usr/app/tests
restart: unless-stopped
cart:
build: ./cart
container_name: "${CART_HOST}"
# Forward ports, format 'container:host'
ports:
- ${CART_PORT}:${CART_PORT}
env_file:
- .env
# Mount local directories on the container filesystem.
# Should not happen in production.
volumes:
- ./cart/src:/usr/app/src
- ./cart/app.js:/usr/app/app.js
- ./cart/process.json:/usr/app/process.json
- ./cart/registrations.js:/usr/app/registrations.js
- ./cart/.cartrc:/usr/app/.cartrc
- ./cart/log:/usr/app/log
- ./cart/test:/usr/app/test
# The above line takes care of making the log dir accessible, but should be
# handled differently in production.
restart: unless-stopped
api-gateway:
build: ./api-gateway
container_name: "${API_GW_HOST}"
env_file:
- .env
volumes:
- ./api-gateway/src:/usr/app/src
- ./api-gateway/process.json:/usr/app/process.json
- ./api-gateway/log:/usr/app/log
depends_on:
- ${INVENTORY_GQL_HOST}
- ${CART_GQL_HOST}
- ${CHECKOUT_GQL_HOST}
expose:
- ${API_GW_PORT}
ports:
- ${API_GW_PORT}:${API_GW_PORT}
environment:
INVENTORY_GRAPHQL_SERVICE: ${INVENTORY_GQL_HOST}
CART_GRAPHQL_SERVICE: ${CART_GQL_HOST}
CHECKOUT_GRAPHQL_SERVICE: ${CHECKOUT_GQL_HOST}
inventory-management-graphql-service:
build: ./inventory-management/graphql-service
container_name: "${INVENTORY_GQL_HOST}"
env_file:
- .env
volumes:
- ./inventory-management/graphql-service/index.js:/usr/app/index.js
- ./inventory-management/graphql-service/datasource.js:/usr/app/datasource.js
- ./inventory-management/graphql-service/process.json:/usr/app/process.json
- ./inventory-management/graphql-service/src:/usr/app/src
- ./inventory-management/graphql-service/log:/usr/app/log
expose:
- ${INVENTORY_GQL_PORT}
ports:
- ${INVENTORY_GQL_PORT}:${INVENTORY_GQL_PORT}
environment:
INVENTORY_SERVICE: inventory-management
cart-graphql-service:
build: ./cart/graphql-service
container_name: "${CART_GQL_HOST}"
env_file:
- .env
volumes:
- ./cart/graphql-service/index.js:/usr/app/index.js
- ./cart/graphql-service/datasource.js:/usr/app/datasource.js
- ./cart/graphql-service/process.json:/usr/app/process.json
- ./cart/graphql-service/src:/usr/app/src
- ./cart/graphql-service/log:/usr/app/log
expose:
- ${CART_GQL_PORT}
ports:
- ${CART_GQL_PORT}:${CART_GQL_PORT}
restart: unless-stopped
environment:
BOILERPLATE_SERVICE: boilerplate
CART_SERVICE: cart
checkout-graphql-service:
build: ./checkout/graphql-service
container_name: "${CHECKOUT_GQL_HOST}"
env_file:
- .env
volumes:
- ./checkout/graphql-service/index.js:/usr/app/index.js
- ./checkout/graphql-service/datasource.js:/usr/app/datasource.js
- ./checkout/graphql-service/process.json:/usr/app/process.json
- ./checkout/graphql-service/src:/usr/app/src
- ./checkout/graphql-service/log:/usr/app/log
expose:
- ${CHECKOUT_GQL_PORT}
ports:
- ${CHECKOUT_GQL_PORT}:${CHECKOUT_GQL_PORT}
restart: unless-stopped
environment:
BOILERPLATE_SERVICE: boilerplate
CHECKOUT_SERVICE: checkout
checkout:
build: ./checkout
container_name: "${CHECKOUT_HOST}"
# Forward ports, format 'container:host'
ports:
- ${CHECKOUT_PORT}:${CHECKOUT_PORT}
env_file:
- .env
# Mount local directories on the container filesystem.
# Should not happen in production.
volumes:
- ./checkout/src:/usr/app/src
- ./checkout/app.js:/usr/app/app.js
- ./checkout/process.json:/usr/app/process.json
- ./checkout/registrations.js:/usr/app/registrations.js
- ./checkout/.checkoutrc:/usr/app/.checkoutrc
- ./checkout/log:/usr/app/log
- ./checkout/test:/usr/app/test
# The above line takes care of making the log dir accessible, but should be
# handled differently in production.
depends_on:
- inventory
- cart
- authentication
restart: unless-stopped
authentication:
build: ./authentication
container_name: "${AUTH_HOST}"
volumes:
- ./authentication/src:/usr/app/src
- ./authentication/app.js:/usr/app/app.js
- ./authentication/process.json:/usr/app/process.json
- ./authentication/registrations.js:/usr/app/registrations.js
- ./authentication/.authenticationrc:/usr/app/.authenticationrc
- ./authentication/log:/usr/app/log
- ./authentication/auth.js:/usr/app/auth.js
- ./authentication/serviceAccountKey.json:/usr/app/serviceAccountKey.json
- ./authentication/firebase-config.json:/usr/app/firebase-config.json
- ./authentication/firebase-client.js:/usr/app/firebase-client.js
env_file:
- .env
expose:
- ${AUTH_PORT}
ports:
- ${AUTH_PORT}:${AUTH_PORT}
restart: unless-stopped