forked from bcgov/tfrs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
192 lines (190 loc) · 6.23 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
185
186
187
188
189
190
191
192
version: '3'
services:
scan-coordinator:
depends_on:
- clamav
- rabbit
environment:
- BYPASS_CLAMAV=false
- AMQP_HOST=rabbit
- AMQP_VHOST=/tfrs
- AMQP_USER=rabbitmq
- AMQP_PASSWORD=rabbitmq
- CLAMAV_HOST=clamav
env_file:
- minio.env
command: >
bash -c
"/wfi/wait-for-it.sh -t 14400 rabbit:5672 &&
/wfi/wait-for-it.sh -t 14400 clamav:3310 &&
scan-coordinator"
build:
dockerfile: Dockerfile
context: ./security-scan/scan-coordinator
db:
build:
dockerfile: Dockerfile-postgres
context: ./postgres
expose:
- 5432
django:
environment:
- DATABASE_NAME=tfrs
- DATABASE_USER=tfrs
- DATABASE_PASSWORD=development_only
- DATABASE_ENGINE=postgresql
- DATABASE_SERVICE_NAME=postgresql
- POSTGRESQL_SERVICE_HOST=db
- POSTGRESQL_SERVICE_PORT=5432
- RABBITMQ_VHOST=/tfrs
- RABBITMQ_USER=rabbitmq
- RABBITMQ_PASSWORD=rabbitmq
- RABBITMQ_HOST=rabbit
- RABBITMQ_PORT=5672
- KEYCLOAK_ENABLED=True
- KEYCLOAK_AUDIENCE=tfrs-app
- KEYCLOAK_CLIENT_ID=tfrs-app
- KEYCLOAK_REALM=http://localhost:8888/auth/realms/tfrs
- KEYCLOAK_ISSUER=http://localhost:8888/auth/realms/tfrs
- KEYCLOAK_CERTS_URL=http://keycloak:8080/auth/realms/tfrs/protocol/openid-connect/certs
- KEYCLOAK_SA_BASEURL=http://keycloak:8080
- KEYCLOAK_SA_REALM=tfrs
- KEYCLOAK_SA_CLIENT_ID=tfrs-app-sa
- KEYCLOAK_SA_CLIENT_SECRET=06dc71d6-1800-4f5d-b7b3-4c4fda226599
- DOCUMENTS_API_ENABLED=True
- SMTP_SERVER_HOST=smtplogger
- SMTP_SERVER_PORT=2500
- EMAIL_SENDING_ENABLED=True
- FUEL_CODES_API_ENABLED=True
- CREDIT_CALCULATION_API_ENABLED=True
- COMPLIANCE_REPORTING_API_ENABLED=True
env_file:
- minio.env
depends_on:
- db
build:
dockerfile: Dockerfile-django
context: ./backend
command: >
bash -c
"pip install -q -r requirements.txt &&
/wfi/wait-for-it.sh -t 14400 rabbit:5672 &&
/wfi/wait-for-it.sh -t 14400 db:5432 &&
/wfi/wait-for-it.sh -t 14400 minio:9000 &&
/wfi/wait-for-it.sh -t 14400 keycloak:8080 &&
/wfi/wait-for-it.sh -t 14400 smtplogger:2500 &&
python3 manage.py makemigrations &&
python3 manage.py migrate &&
python3 manage.py createcachetable &&
python3 manage.py load_ops_data api/fixtures/development/dockerized.py &&
supervisord"
expose:
- 8000
volumes:
- ./backend:/app
node:
build:
dockerfile: Dockerfile-node
context: ./frontend
command: >
bash -c
"npm install &&
/wfi/wait-for-it.sh rabbit:5672 -t 14400 &&
npm run start:docker"
depends_on:
- rabbit
expose:
- 3000
environment:
- RABBITMQ_VHOST=/tfrs
- RABBITMQ_USER=rabbitmq
- RABBITMQ_PASSWORD=rabbitmq
- RABBITMQ_HOST=rabbit
- RABBITMQ_PORT=5672
- KEYCLOAK_ENABLED=False
- KEYCLOAK_AUTHORITY=http://localhost:8888/auth/realms/tfrs
- KEYCLOAK_CLIENT_ID=tfrs-app
- KEYCLOAK_REALM=http://localhost:8888/auth/realms/tfrs
- KEYCLOAK_ISSUER=http://localhost:8888/auth/realms/tfrs
- KEYCLOAK_CALLBACK_URL=http://localhost:5001/authCallback
- KEYCLOAK_POST_LOGOUT_URL=http://localhost:5001/
- KEYCLOAK_CERTS_URL=http://keycloak:8080/auth/realms/tfrs/protocol/openid-connect/certs
volumes:
- ./frontend:/app
- node_modules:/app/node_modules
nginx:
depends_on:
- django
- node
build:
dockerfile: Dockerfile-nginx
context: ./nginx
ports:
- 5001:10920
command: >
bash -c
"cat /tfrs/ready.txt &&
nginx -g \"daemon off;\""
clamav:
image: mkodockx/docker-clamav
ports:
- 3310:3310
rabbit:
image: rabbitmq:3.7-management
hostname: "rabbit"
environment:
- RABBITMQ_DEFAULT_USER=rabbitmq
- RABBITMQ_DEFAULT_PASS=rabbitmq
- RABBITMQ_DEFAULT_VHOST=/tfrs
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit log_levels [{connection,error}]
ports:
- 15672:15672
- 5672:5672
postgres_keycloak:
image: postgres
volumes:
- postgres_keycloak_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak
keycloak:
build:
context: ./keycloak
dockerfile: Dockerfile-keycloak
command: -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=/tmp/realm.json -Dkeycloak.migration.strategy=IGNORE_EXISTING
environment:
DB_VENDOR: POSTGRES
DB_ADDR: postgres_keycloak
DB_DATABASE: keycloak
DB_USER: keycloak
DB_PASSWORD: keycloak
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_LOGLEVEL: WARN
ROOT_LOGLEVEL: WARN
ports:
- 8888:8080
depends_on:
- postgres_keycloak
minio:
image: minio/minio
volumes:
- minio_data:/export
environment:
MINIO_ACCESS_KEY: 296e92217fa3479aaf9cc9641fdb6e0a
MINIO_SECRET_KEY: 778eecb24d7743b5a1b56bbf36a29d62
ports:
- 9000:9000
command: "server /export"
smtplogger:
build:
context: ./smtplogger
dockerfile: Dockerfile-smtplogger
ports:
- 2500:2500
volumes:
node_modules:
postgres_keycloak_data:
minio_data: