generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
168 lines (157 loc) · 5.04 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
---
x-postgres-vars: &postgres-vars
POSTGRES_DB: spar
POSTGRES_HOST: database
POSTGRES_USER: postgres
POSTGRES_PASSWORD: default
POSTGRES_PORT: 5432
x-frontend: &frontend
depends_on:
backend:
condition: service_started
environment:
VITE_SERVER_URL: http://localhost:8090
VITE_ORACLE_SERVER_URL: https://nr-spar-test-oracle-api.apps.silver.devops.gov.bc.ca
LOG_LEVEL: debug
VITE_USER_POOLS_ID: ca-central-1_t2HSZBHur
VITE_USER_POOLS_WEB_CLIENT_ID: 6jmscjfesregki1pvng2oiopc3
VITE_ZONE: TEST
healthcheck:
test: timeout 10s bash -c 'true > /dev/tcp/127.0.0.1/3000'
services:
database:
container_name: database
image: postgis/postgis:15-master
environment:
<<: *postgres-vars
volumes:
- "/pgdata"
- "./common/init_db:/init_db"
ports: ["5432:5432"]
healthcheck:
test: psql -q -U $${POSTGRES_USER} -d $${POSTGRES_DB} -c 'SELECT 1'
backend:
container_name: backend
depends_on:
database:
condition: service_started
environment:
ALLOWED_ORIGINS: "http://localhost:*"
FORESTCLIENTAPI_ADDRESS: https://nr-forest-client-api-prod.api.gov.bc.ca/api
FORESTCLIENTAPI_KEY: "${FORESTCLIENTAPI_KEY}"
ORACLE_SERVER_URL: https://nr-spar-test-oracle-api.apps.silver.devops.gov.bc.ca
POSTGRES_HOST: database
AWS_COGNITO_ISSUER_URI: "https://cognito-idp.ca-central-1.amazonaws.com/ca-central-1_t2HSZBHur"
<<: *postgres-vars
ports: ["8090:8090", "5005:5005"]
image: maven:3.9.9-eclipse-temurin-17
entrypoint: sh -c './encora-cert.sh'
working_dir: /app
volumes:
- ./backend:/app
- $HOME/zscaler-certs:/certs
healthcheck:
test: curl -f http://localhost:8090/health | grep '"status":"UP"'
frontend:
container_name: frontend
image: node:18-bullseye-slim
ports: ["3000:3000"]
entrypoint: sh -c "npm i --no-update-notifier && npm run start"
user: root
volumes: ["./frontend:/app"]
working_dir: /app
<<: *frontend
caddy:
container_name: caddy
profiles: ["caddy"]
build: ./frontend
ports: ["3005:3000"]
volumes: ["./frontend/Caddyfile:/etc/caddy/Caddyfile"]
<<: *frontend
# Cypress image tag must match what's in frontend/package.json
cypress:
container_name: cypress
depends_on:
frontend:
condition: service_started
entrypoint: sh -c "npm run cy:run --no-update-notifier"
environment:
CYPRESS_baseUrl: http://frontend:3000
CYPRESS_USERNAME: LOAD-3-TEST
CYPRESS_PASSWORD: ${CYPRESS_PASSWORD}
image: cypress/included:12.17.4
profiles: ["cypress"]
user: root
volumes: ["./frontend:/app"]
working_dir: /app
oracle-api:
container_name: oracle-api
environment:
DATABASE_HOST: ${DATABASE_HOST:-"nrcdb03.bcgov"}
DATABASE_PORT: ${DATABASE_PORT:-"1543"}
DATABASE_USER: ${DATABASE_USER}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
SERVICE_NAME: ${SERVICE_NAME:-"dbq01.nrs.bcgov"}
SERVER_PORT: "8091"
ORACLEDB_KEYSTORE: /app/jssecacerts
ORACLEDB_SECRET: changeit
AWS_COGNITO_ISSUER_URI: "https://cognito-idp.ca-central-1.amazonaws.com/ca-central-1_t2HSZBHur"
profiles: ["oracle-api"]
network_mode: host
image: maven:3.9.9-eclipse-temurin-17
entrypoint: sh -c './startup.sh && mvn -ntp spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5006"'
working_dir: /app
volumes: ["./oracle-api:/app"]
healthcheck:
test: curl -f http://localhost:8091/actuator/health | grep '"status":"UP"'
schemaspy:
container_name: schemaspy
profiles: ["schemaspy"]
image: schemaspy/schemaspy:6.2.4
user: ${UID:-""}:${GID:-""}
volumes:
- "./schemaspy/output:/output"
- "./schemaspy/postgres.properties:/schemaspy.properties"
depends_on:
database:
condition: service_healthy
backend:
condition: service_healthy
# PGAdmin
pgadmin:
container_name: pgadmin
profiles: ["pgadmin"]
entrypoint: sh -c "echo 'Browse => http://localhost:5050' && /entrypoint.sh"
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
image: dpage/pgadmin4
ports: [5050:80]
depends_on:
database:
condition: service_started
sync:
container_name: sync
profiles: ["sync"]
build: ./sync
develop:
watch:
- action: sync
path: ./sync
target: ./sync
- action: rebuild
path: ./sync/requirements.txt
target: ./sync/requirements.txt
environment:
<<: *postgres-vars
TEST_MODE: ${TEST_MODE:-false}
EXECUTION_ID: ${EXECUTION_ID:-100}
DATABASE_HOST: database
ORACLE_HOST: ${ORACLE_HOST:-nrcdb03.bcgov}
ORACLE_PORT: ${ORACLE_PORT:-1543}
ORACLE_SERVICE: ${ORACLE_SERVICE:-dbq01.nrs.bcgov}
ORACLE_SYNC_PASSWORD: ${ORACLE_SYNC_PASSWORD}
ORACLE_SYNC_USER: ${ORACLE_SYNC_USER:-proxy_fsa_spar_read_only_user}
depends_on:
database:
condition: service_started