-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
184 lines (183 loc) · 6.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
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
version: '2.4'
services:
db:
image: postgres:11
command: postgres -c 'max_connections=1000'
environment:
- POSTGRES_DB=ab2d
- POSTGRES_USER=ab2d
- POSTGRES_PASSWORD=ab2d
# Docker exposes these ports to all containers in the compose by default
# but if you are debugging on a local machine uncomment to test connectivity or open a connection
# to the Postgres database
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
localstack:
image: localstack/localstack:1.0.2
environment:
- AWS_DEFAULT_REGION=us-east-1
- EDGE_PORT=4566
- SERVICES=sqs,sns
ports:
- '4566:4566'
volumes:
- tmp-volume:/opt/ab2d
healthcheck:
test: awslocal sqs list-queues
interval: 10s
timeout: 5s
retries: 40
build:
image: maven:3-openjdk-17
working_dir: /usr/src/mymaven
# Not necessary to run mvn package since we anticipate that project
# has already built so we don't need to run this command
command: ls /usr/src/mymaven/*/target && ls /root/.m2/repository
volumes:
- "${PWD}:/usr/src/mymaven"
- "${HOME}/.m2:/root/.m2"
api:
build:
context: ./api
environment:
# Limit RAM usage of each container because containers share a VM
- JVM_INITIAL_RAM=${JVM_INITIAL_RAM:-5.0}
- JVM_MIN_RAM=${JVM_MIN_RAM:-5.0}
- JVM_MAX_RAM=${JVM_MAX_RAM:-10.0}
# Postgres DB container credentials and config
- AB2D_DB_HOST=db
- AB2D_DB_PORT=5432
- AB2D_DB_DATABASE=ab2d
- AB2D_DB_SSL_MODE=allow
- AB2D_DB_USER=ab2d
- AB2D_DB_PASSWORD=ab2d
# Location to store file within container
- AB2D_EFS_MOUNT=/opt/ab2d
- NEW_RELIC_LICENSE_KEY="${NEW_RELIC_LICENSE_KEY}"
- NEW_RELIC_APP_NAME="${NEW_RELIC_APP_NAME}"
# LOCAL always to shut off Kinesis logging
- AB2D_EXECUTION_ENV=${AB2D_EXECUTION_ENV:-local}
- AB2D_V2_ENABLED=${AB2D_V2_ENABLED}
- AWS_SQS_URL=http://localstack:4566
- PROPERTIES_SERVICE_URL=contracts:8070
# Only Needed if running Locally
# - AWS_ACCESS_KEY_ID=null
# - AWS_SECRET_KEY=null
ports:
# Set port as an environment variable
# The e2e-test forcefully sets this itself otherwise set via command line
- "${API_PORT}:8443"
healthcheck:
test: [ "CMD-SHELL", "curl -X GET https://localhost:8443/health --insecure" ]
interval: 5s
timeout: 5s
retries: 40
depends_on:
db:
condition: service_healthy
localstack:
condition: service_healthy
volumes:
- tmp-volume:/opt/ab2d
worker:
build:
context: ./worker
environment:
# Limit RAM usage of each container because containers share a VM
- JVM_INITIAL_RAM=${JVM_INITIAL_RAM:-5.0}
- JVM_MIN_RAM=${JVM_MIN_RAM:-5.0}
- JVM_MAX_RAM=${JVM_MAX_RAM:-15.0}
# DB credentials
- AB2D_DB_HOST=db
- AB2D_DB_PORT=5432
- AB2D_DB_DATABASE=ab2d
- AB2D_DB_SSL_MODE=allow
- AB2D_DB_USER=ab2d
- AB2D_DB_PASSWORD=ab2d
# Location to store files within container
- AB2D_EFS_MOUNT=/opt/ab2d
# LOCAL always to shut off Kinesis logging
- AB2D_EXECUTION_ENV=${AB2D_EXECUTION_ENV:-local}
# BFD prod sandbox credentials and location
- AB2D_BFD_URL=https://prod-sbx.bfd.cms.gov
- AB2D_BFD_KEYSTORE_PASSWORD=${AB2D_BFD_KEYSTORE_PASSWORD}
- AB2D_BFD_KEYSTORE_LOCATION=${AB2D_BFD_KEYSTORE_LOCATION}
- NEW_RELIC_LICENSE_KEY="${NEW_RELIC_LICENSE_KEY}"
- NEW_RELIC_APP_NAME="${NEW_RELIC_APP_NAME}"
# Cert used to prove that keystore app has rights to bfd sandbox
- AB2D_KEYSTORE_LOCATION=${AB2D_KEYSTORE_LOCATION}
- AB2D_KEYSTORE_PASSWORD=${AB2D_KEYSTORE_PASSWORD}
- AB2D_KEY_ALIAS=${AB2D_KEY_ALIAS}
- AWS_SQS_URL=http://localstack:4566
- PROPERTIES_SERVICE_URL=contracts:8070
# Update coverage frequently so that tests aren't slowed down too much
- "COVERAGE_UPDATE_LOAD_SCHEDULE=0/1 * * * * ?"
- "COVERAGE_UPDATE_MONITORING_INTERVAL=0/1 * * * * ?"
# Disable verification during e2e tests
- "COVERAGE_VERIFY_SCHEDULE=0 0 0 1 * ? 2099"
# Only Needed if running Locally
# - AWS_ACCESS_KEY_ID=null
# - AWS_SECRET_KEY=null
depends_on:
db:
condition: service_healthy
contracts:
condition: service_healthy
localstack:
condition: service_healthy
volumes:
- tmp-volume:/opt/ab2d
contracts:
image: 777200079629.dkr.ecr.us-east-1.amazonaws.com/ab2d-sbx-services:contracts-service
# Use if running locally. Build imqge in Contract Service repo first
# image: ab2d-contracts-contracts
environment:
- AB2D_DB_HOST=db
- AB2D_DB_PORT=5432
- AB2D_DB_DATABASE=ab2d
- AB2D_DB_SSL_MODE=allow
- AB2D_DB_USER=ab2d
- AB2D_DB_PASSWORD=ab2d
- AB2D_CLAIMS_SKIP_BILLABLE_PERIOD_CHECK=true
- AB2D_V2_ENABLED=true
- HPMS_INGEST_SCHEDULE=0 0/1 * * * ?
- AWS_SQS_URL=http://localstack:4566
- HPMS_AUTH_KEY_ID="${HPMS_AUTH_KEY_ID}"
- HPMS_AUTH_KEY_SECRET="${HPMS_AUTH_KEY_SECRET}"
- AB2D_HPMS_URL=${AB2D_HPMS_URL}
- PROPERTIES_SERVICE_URL=properties:8070
# Only Needed if running Locally
# - AWS_ACCESS_KEY_ID=null
# - AWS_SECRET_KEY=null
healthcheck:
test: [ "CMD-SHELL", "curl -X GET http://localhost:8070/health --insecure" ]
interval: 30s
timeout: 5s
retries: 5
ports:
- '8070:8070'
expose:
- 8070
depends_on:
db:
condition: service_healthy
# API must come up before contracts to create db schema
api:
condition: service_healthy
localstack:
condition: service_healthy
volumes:
- tmp-volume:/opt/ab2d
# This needs a shared volume so that both the API and worker module can access the ndjson files being generated
volumes:
tmp-volume:
driver: local
driver_opts:
type: none
device: /opt/ab2d
o: bind