-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
158 lines (145 loc) · 4.03 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
version: "3.9"
x-common-args: &common-args
DEPLOYMENT_ENVIRONMENT: development
x-common-environment: &common-environment
ACCESS_TOKEN_PUBLIC_KEY_PEM: |
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEN60b96+vHHiVRHD02BnbaarnMQHe0pNk
wnch0vkKkADmh9hHc/6cirDZDDr505/o+RHkdI01bRL/dODYOgv5ofa0XR1S3Uug
pYrUr68jGm/Zbmi9BgzCbt9DPkOcCd5W
-----END PUBLIC KEY-----
ALLOWED_ORIGINS: http://localhost,http://front-end-react
DATABASE_URL: postgresql+asyncpg://arad_application:arad_application@database:5432/arad_application
LISTEN_IP: "0.0.0.0"
x-healthcheck: &healthcheck
test: ["CMD-SHELL", "curl http://localhost/health > /dev/null"]
interval: 5s
timeout: 5s
retries: 5
x-database-dependency: &database-dependency
database:
condition: service_healthy
services:
front-end-react:
build:
context: src/front-end
args: *common-args
volumes:
- './src/front-end:/app'
- '/app/node_modules'
depends_on:
api:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl http://localhost > /dev/null"]
interval: 10s
timeout: 10s
retries: 11
ports:
- "80:80"
api:
build:
context: infrastructure/api
args: *common-args
depends_on:
identity:
condition: service_healthy
reader:
condition: service_healthy
reviewer:
condition: service_healthy
administrator:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl http://localhost/health > /dev/null"]
interval: 5s
timeout: 5s
retries: 5
ports:
- "8080:80" # this is how the front end talks to the api
identity:
build:
context: src/service/identity
args: *common-args
restart: always
environment:
<<: *common-environment
NOMAD_JOB_NAME: identity_service
DATABASE_URL: postgresql+asyncpg://arad_user:arad_user@database:5432/arad_user
CACHE_URL: redis://cache:6379/0
DEFAULT_ADMIN_EMAIL: [email protected]
ACCESS_TOKEN_PRIVATE_KEY_PEM: |
-----BEGIN EC PRIVATE KEY-----
MIGkAgEBBDDjQPP27NwYB6EuNB/V4lUTjgcQgWNdX5T/n6iogIkNzF2ieKyYjAe1
6+dKIhGyqK+gBwYFK4EEACKhZANiAAQ3rRv3r68ceJVEcPTYGdtpqucxAd7Sk2TC
dyHS+QqQAOaH2Edz/pyKsNkMOvnTn+j5EeR0jTVtEv904Ng6C/mh9rRdHVLdS6Cl
itSvryMab9luaL0GDMJu30M+Q5wJ3lY=
-----END EC PRIVATE KEY-----
volumes:
- './src/service/identity:/app'
depends_on:
<<: *database-dependency
cache:
condition: service_healthy
healthcheck: *healthcheck
reader:
build:
context: src/service/reader
args: *common-args
restart: always
environment:
<<: *common-environment
NOMAD_JOB_NAME: reader_service
volumes:
- './src/service/reader:/app'
depends_on: *database-dependency
healthcheck: *healthcheck
reviewer:
build:
context: src/service/reviewer
args: *common-args
restart: always
environment:
<<: *common-environment
NOMAD_JOB_NAME: reviewer_service
volumes:
- './src/service/reviewer:/app'
depends_on: *database-dependency
healthcheck: *healthcheck
administrator:
build:
context: src/service/administrator
args: *common-args
restart: always
environment:
<<: *common-environment
NOMAD_JOB_NAME: administrator_service
volumes:
- './src/service/administrator:/app'
depends_on: *database-dependency
healthcheck: *healthcheck
cache:
image: "redis:bullseye"
restart: always
volumes:
- 'cache:/bitnami/redis/data'
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 5s
timeout: 5s
retries: 5
database:
image: "postgres:14-bullseye"
restart: always
environment:
POSTGRES_PASSWORD: postgres
volumes:
- 'database:/var/lib/postgresql/data'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes:
cache:
database: