forked from USACE/cwms-data-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
149 lines (143 loc) · 4.87 KB
/
Copy pathdocker-compose.yml
File metadata and controls
149 lines (143 loc) · 4.87 KB
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
volumes:
oracle_data_1:
auth_data:
services:
db:
image: ghcr.io/hydrologicengineeringcenter/cwms-database/cwms/database-ready-ora-23.5:latest-dev
environment:
#- ORACLE_DATABASE=FREEPDB1
- ORACLE_PASSWORD=badSYSpassword
- CWMS_PASSWORD=simplecwmspasswD1
- OFFICE_ID=HQ
- OFFICE_EROC=s0
ports:
- "1525:1521"
healthcheck:
test: ["CMD-SHELL","sqlplus -s -L sys/badSYSpassword@localhost:1521/FREEPDB1 as sysdba <<< 'exit;'"]
interval: 30s
timeout: 50s
retries: 50
start_period: 40m
db_webuser_permissions:
image: ${CWMS_SCHEMA_INSTALLER_IMAGE:-registry-public.hecdev.net/cwms/schema_installer:latest-dev}
restart: "no"
environment:
- DB_HOST_PORT=db:1521
- DB_NAME=/FREEPDB1
- CWMS_PASSWORD=simplecwmspasswD1
- SYS_PASSWORD=badSYSpassword
# set to HQ/q0 for any national system work
- OFFICE_ID=HQ
- OFFICE_EROC=s0
- INSTALLONCE=1
- QUIET=1
command: >
sh -xc "sqlplus CWMS_20/$$CWMS_PASSWORD@$$DB_HOST_PORT$$DB_NAME @/setup_sql/users $$OFFICE_EROC"
volumes:
- ./compose_files/sql:/setup_sql:ro
depends_on:
db:
condition: service_healthy
data-api:
depends_on:
auth:
condition: service_healthy
db:
condition: service_healthy
db_webuser_permissions:
condition: service_completed_successfully
traefik:
condition: service_healthy
image: cwms-rest-api:local-dev
build:
target: api
context: .
dockerfile: Dockerfile
#command: bash -c "/conf/installcerts.sh && /usr/local/tomcat/bin/catalina.sh run"
restart: unless-stopped
volumes:
- ./compose_files/pki/certs:/conf/
- ./compose_files/tomcat/logging.properties:/usr/local/tomcat/conf/logging.properties:ro
environment:
- JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
- CDA_JDBC_DRIVER=oracle.jdbc.driver.OracleDriver
- CDA_JDBC_URL=jdbc:oracle:thin:@db/FREEPDB1
- CDA_JDBC_USERNAME=s0webtest
- CDA_JDBC_PASSWORD=simplecwmspasswD1
- CDA_POOL_INIT_SIZE=5
- CDA_POOL_MAX_ACTIVE=10
- CDA_POOL_MAX_IDLE=5
- CDA_POOL_MIN_IDLE=2
- cwms.dataapi.access.provider=MultipleAccessManager
- cwms.dataapi.access.providers=KeyAccessManager,OpenID
- cwms.dataapi.access.openid.create_users=true
- cwms.dataapi.access.openid.wellKnownUrl=http://auth:${APP_PORT:-8081}/auth/realms/cwms/.well-known/openid-configuration
- cwms.dataapi.access.openid.altAuthUrl=http://localhost:${APP_PORT:-8081}
- cwms.dataapi.access.openid.useAltWellKnown=true
- cwms.dataapi.access.openid.issuer=http://localhost:${APP_PORT:-8081}/auth/realms/cwms
expose:
- 7000
- 5005
healthcheck:
test: ["CMD","/usr/bin/curl", "-I","localhost:7000/cwms-data/offices/HEC"]
interval: 5s
timeout: 1s
retries: 100
start_period: 2s
labels:
- "traefik.enable=true"
- "traefik.http.routers.data-api.rule=PathPrefix(`/cwms-data`)"
- "traefik.http.routers.data-api.entryPoints=web"
- "traefik.http.services.data-api.loadbalancer.server.port=7000"
auth:
image: quay.io/keycloak/keycloak:19.0.1
command: ["start-dev", "--features-disabled=admin2","--import-realm"]
healthcheck:
test: "/usr/bin/curl -If localhost:${APP_PORT:-8081}/auth/health/ready || exit 1"
interval: 5s
timeout: 1s
retries: 100
start_period: 2s
environment:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
- KC_HEALTH_ENABLED=true
- KC_FEATURES=admin-fine-grained-authz
- KC_HTTP_PORT=${APP_PORT:-8081}
- KEYCLOAK_FRONTEND_URL=http://localhost:${APP_PORT:-8081}
- KC_HOSTNAME_STRICT=false
- KC_PROXY=none
- KC_HTTP_ENABLED=true
- KC_HTTP_RELATIVE_PATH=/auth
volumes:
- ./compose_files/keycloak/realm.json:/opt/keycloak/data/import/realm.json:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.auth.rule=PathPrefix(`/auth`)"
- "traefik.http.routers.auth.entryPoints=web"
- "traefik.http.services.auth.loadbalancer.server.port=${APP_PORT:-8081}"
depends_on:
traefik:
condition: service_healthy
# Proxy for HTTPS for OpenID
traefik:
image: "traefik:v3.6.2"
ports:
- "${APP_PORT:-8081}:80"
expose:
- "8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
healthcheck:
test: traefik healthcheck --ping
command:
- "--entrypoints.web.address=:80"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--ping"
- "--log.level=DEBUG"
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=PathPrefix(`/traefik`)"
- "traefik.http.routers.traefik.service=api@internal"