Skip to content

Commit 41aa582

Browse files
authored
Check for Database ready in a way that verifies we can connect to the… (#1233)
… database. Found that the database isn't actually ready just because tnsping returns, which can cause some automated usage issues and things run too fast and don't attempt to run again.
1 parent 14a7882 commit 41aa582

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

docker-compose.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
ports:
1414
- "1525:1521"
1515
healthcheck:
16-
test: ["CMD","tnsping", "FREEPDB1"]
16+
test: ["CMD-SHELL","sqlplus -s -L sys/badSYSpassword@localhost:1521/FREEPDB1 as sysdba <<< 'exit;'"]
1717
interval: 30s
1818
timeout: 50s
1919
retries: 50
@@ -55,12 +55,13 @@ services:
5555
target: api
5656
context: .
5757
dockerfile: Dockerfile
58-
command: bash -c "/conf/installcerts.sh && /usr/local/tomcat/bin/catalina.sh run"
58+
#command: bash -c "/conf/installcerts.sh && /usr/local/tomcat/bin/catalina.sh run"
5959
restart: unless-stopped
6060
volumes:
6161
- ./compose_files/pki/certs:/conf/
6262
- ./compose_files/tomcat/logging.properties:/usr/local/tomcat/conf/logging.properties:ro
6363
environment:
64+
- JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
6465
- CDA_JDBC_DRIVER=oracle.jdbc.driver.OracleDriver
6566
- CDA_JDBC_URL=jdbc:oracle:thin:@db/FREEPDB1
6667
- CDA_JDBC_USERNAME=s0webtest
@@ -78,6 +79,7 @@ services:
7879
- cwms.dataapi.access.openid.issuer=http://localhost:${APP_PORT:-8081}/auth/realms/cwms
7980
expose:
8081
- 7000
82+
- 5005
8183
healthcheck:
8284
test: ["CMD","/usr/bin/curl", "-I","localhost:7000/cwms-data/offices/HEC"]
8385
interval: 5s
@@ -88,6 +90,7 @@ services:
8890
- "traefik.enable=true"
8991
- "traefik.http.routers.data-api.rule=PathPrefix(`/cwms-data`)"
9092
- "traefik.http.routers.data-api.entryPoints=web"
93+
- "traefik.http.services.data-api.loadbalancer.server.port=7000"
9194

9295
auth:
9396
image: quay.io/keycloak/keycloak:19.0.1

0 commit comments

Comments
 (0)