-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
184 lines (171 loc) · 6.22 KB
/
docker-compose.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
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
version: '2.4'
networks:
bridge-net:
external: true
services:
gateway:
build:
context: $PWD/gateway
args:
BASE_IMAGE: ${GOHAN_GATEWAY_BASE_IMAGE}
BASE_IMAGE_VERSION: ${GOHAN_GATEWAY_BASE_IMAGE_VERSION}
DRS_BASIC_AUTH_FILE_PATH: ${GOHAN_DRS_BASIC_AUTH_FILE_PATH}
networks:
- ${GOHAN_DOCKER_NET}
mem_limit: ${GOHAN_GATEWAY_MEM_LIM} # for mem_limit to work, make sure docker-compose is v2.4
cpus: ${GOHAN_GATEWAY_CPUS}
cpu_shares: 512
image: ${GOHAN_GATEWAY_IMAGE}:${GOHAN_GATEWAY_VERSION}
container_name: ${GOHAN_GATEWAY_CONTAINER_NAME}
ports:
- "${GOHAN_INSECURE_PUBLIC_PORT}:80"
- "${GOHAN_PUBLIC_PORT}:443"
healthcheck:
test: [ "CMD", "curl", "https://localhost:443", "-k" ]
timeout: 5s
interval: 1m
retries: 3
api:
build:
context: $PWD/src/api
args:
BUILDER_BASE_IMAGE: ${GOHAN_API_BUILDER_BASE_IMAGE}
BASE_PROD_IMAGE: ${GOHAN_API_PROD_BASE_IMAGE}
BASE_DEV_IMAGE: ${GOHAN_API_PROD_BASE_IMAGE}
# also passed in as an ENV from within Dockerfile :
GOHAN_API_INTERNAL_PORT: ${GOHAN_API_INTERNAL_PORT}
networks:
- ${GOHAN_DOCKER_NET}
mem_limit: ${GOHAN_API_MEM_LIM} # for mem_limit to work, make sure docker-compose is v2.4
cpus: ${GOHAN_API_CPUS}
cpu_shares: 1024
image: ${GOHAN_API_IMAGE}:${GOHAN_API_VERSION}
container_name: ${GOHAN_API_CONTAINER_NAME}
environment:
# Image
- BENTO_UID=${UID}
- BENTO_GID=${GID}
# API
- GOHAN_DEBUG=${GOHAN_DEBUG}
- GOHAN_SERVICE_CONTACT=${GOHAN_SERVICE_CONTACT}
- GOHAN_SEMVER=${GOHAN_SEMVER}
- GOHAN_API_VCF_PATH=${GOHAN_API_CONTAINERIZED_VCF_PATH}
- GOHAN_API_GTF_PATH=${GOHAN_API_CONTAINERIZED_GTF_PATH}
- GOHAN_API_API_DRS_BRIDGE_DIR=${GOHAN_API_API_DRS_BRIDGE_DIR_CONTAINERIZED}
- GOHAN_API_BULK_INDEXING_CAP=${GOHAN_API_BULK_INDEXING_CAP}
- GOHAN_API_FILE_PROC_CONC_LVL=${GOHAN_API_FILE_PROC_CONC_LVL}
- GOHAN_API_LINE_PROC_CONC_LVL=${GOHAN_API_LINE_PROC_CONC_LVL}
- GOHAN_API_INTERNAL_PORT
# Elasticsearch
- GOHAN_ES_URL=${GOHAN_PRIVATE_ES_URL}
- GOHAN_ES_USERNAME=${GOHAN_ES_USERNAME}
- GOHAN_ES_PASSWORD=${GOHAN_ES_PASSWORD}
# AuthX
- GOHAN_AUTHZ_ENABLED=${GOHAN_API_AUTHZ_ENABLED}
- GOHAN_PUBLIC_AUTHN_JWKS_URL=${GOHAN_PUBLIC_AUTHN_JWKS_URL}
- GOHAN_PRIVATE_AUTHZ_URL=${GOHAN_PRIVATE_AUTHZ_URL}
- GOHAN_AUTHZ_REQHEADS=${GOHAN_API_AUTHZ_REQHEADS}
# DRS
- GOHAN_DRS_URL=${GOHAN_PRIVATE_DRS_URL}
- GOHAN_DRS_BASIC_AUTH_USERNAME=${GOHAN_DRS_BASIC_AUTH_USERNAME}
- GOHAN_DRS_BASIC_AUTH_PASSWORD=${GOHAN_DRS_BASIC_AUTH_PASSWORD}
- GOHAN_DRS_API_DRS_BRIDGE_DIR=${GOHAN_DRS_API_DRS_BRIDGE_DIR_CONTAINERIZED}
volumes:
- ${GOHAN_API_VCF_PATH}:${GOHAN_API_CONTAINERIZED_VCF_PATH}
- ${GOHAN_API_GTF_PATH}:${GOHAN_API_CONTAINERIZED_GTF_PATH}
- ${GOHAN_API_DRS_BRIDGE_HOST_DIR}:${GOHAN_API_API_DRS_BRIDGE_DIR_CONTAINERIZED}
healthcheck:
test: [ "CMD", "curl", "http://localhost:${GOHAN_API_INTERNAL_PORT}" ]
timeout: 5s
interval: 1m
retries: 3
elasticsearch:
image: ${GOHAN_ES_IMAGE}:${GOHAN_ES_VERSION}
build:
context: $PWD/elasticsearch
args:
BASE_IMAGE: ${GOHAN_ES_BASE_IMAGE}
BASE_IMAGE_VERSION: ${GOHAN_ES_BASE_VERSION}
mem_limit: ${GOHAN_ES_MEM_LIM} # for mem_limit to work, make sure docker-compose is v2.4
cpus: ${GOHAN_ES_CPUS}
cpu_shares: 2048
container_name: ${GOHAN_ES_CONTAINER_NAME}
networks:
- ${GOHAN_DOCKER_NET}
environment:
# Image
- BENTO_UID=${UID}
- BENTO_GID=${GID}
# ES
- ELASTIC_USERNAME=${GOHAN_ES_USERNAME}
- ELASTIC_PASSWORD=${GOHAN_ES_PASSWORD}
- ${GOHAN_ES_JAVA_OPTS}
- xpack.security.enabled=true
- discovery.type=${GOHAN_ES_DISC_TYP}
volumes:
- ${GOHAN_ES_DATA_DIR}:/usr/share/elasticsearch/data
healthcheck:
test: [ "CMD", "curl", "http://localhost:${GOHAN_ES_INTERNAL_PORT_1}" ]
timeout: 5s
interval: 1m
retries: 3
kibana:
mem_limit: ${GOHAN_KB_MEM_LIM} # for mem_limit to work, make sure docker-compose is v2.4
cpus: ${GOHAN_KB_CPUS}
cpu_shares: 1024
image: ${GOHAN_KB_BASE_IMAGE}:${GOHAN_KB_BASE_VERSION}
container_name: ${GOHAN_KB_CONTAINER_NAME}
networks:
- ${GOHAN_DOCKER_NET}
environment:
- ELASTICSEARCH_URL=${GOHAN_KB_ES_HOST}:${GOHAN_KB_ES_PORT}
- ELASTICSEARCH_USERNAME=${GOHAN_ES_USERNAME}
- ELASTICSEARCH_PASSWORD=${GOHAN_ES_PASSWORD}
healthcheck:
test: [ "CMD", "curl", "http://localhost:${GOHAN_KB_INTERNAL_PORT}" ]
timeout: 5s
interval: 1m
retries: 3
drs:
mem_limit: ${GOHAN_DRS_MEM_LIM} # for mem_limit to work, make sure docker-compose is v2.4
cpus: ${GOHAN_DRS_CPUS}
cpu_shares: 512
image: ${GOHAN_DRS_IMAGE}:${GOHAN_DRS_VERSION}
container_name: ${GOHAN_DRS_CONTAINER_NAME}
networks:
- ${GOHAN_DOCKER_NET}
environment:
# Runtime
- FLASK_DEBUG=False
- FLASK_APP=app
- DATABASE=/drs/bento_drs/data/db/ # slightly confused naming, folder for database to go in
- DATA=/drs/bento_drs/data/obj/ # DRS file objects, vs. the database
- INTERNAL_PORT=${GOHAN_DRS_INTERNAL_PORT}
- AUTHZ_ENABLED=False
volumes:
- ${GOHAN_DRS_DATA_DIR}:/drs/bento_drs/data
- ${GOHAN_API_DRS_BRIDGE_HOST_DIR}:${GOHAN_DRS_API_DRS_BRIDGE_DIR_CONTAINERIZED}
healthcheck:
test: [ "CMD", "curl", "http://localhost:${GOHAN_DRS_INTERNAL_PORT}" ]
timeout: 5s
interval: 1m
retries: 3
authorization:
build:
context: $PWD/authorization
args:
- BASE_IMAGE=${GOHAN_AUTHZ_OPA_BASE_IMAGE}:${GOHAN_AUTHZ_OPA_BASE_IMAGE_VERSION}
mem_limit: ${GOHAN_AUTHZ_MEM_LIM} # for mem_limit to work, make sure docker-compose is v2.4
cpus: ${GOHAN_AUTHZ_CPUS}
cpu_shares: 512
image: ${GOHAN_AUTHZ_OPA_IMAGE}:${GOHAN_AUTHZ_OPA_IMAGE_VERSION}
container_name: ${GOHAN_AUTHZ_OPA_CONTAINER_NAME}
networks:
- ${GOHAN_DOCKER_NET}
expose:
- "${GOHAN_AUTHZ_OPA_INTERNAL_PORT}"
command:
- "run"
- "--server"
- "--log-level=debug"
- "/api.policy.rego"