Skip to content

Commit

Permalink
feat(ci): compose/oc cleanup and consistency (#1306)
Browse files Browse the repository at this point in the history
Co-authored-by: Ricardo Campos <[email protected]>
  • Loading branch information
DerekRoberts and Ricardo Campos authored Jul 1, 2024
1 parent de9fcb4 commit 5d82090
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
2 changes: 1 addition & 1 deletion database/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ RUN sed -i '/EXISTS postgis_tiger_geocoder;*/a CREATE EXTENSION IF NOT EXISTS pg
# User, port and Healthcheck
USER postgres
EXPOSE 5432
HEALTHCHECK --interval=5s --timeout=5s --retries=5 CMD [ "pg_isready", "-U", ${POSTGRES_USER} ]
HEALTHCHECK --interval=5s --timeout=5s --retries=5 CMD ["psql", "-q", "-U", "$${POSTGRES_USER}", "-d", "$${POSTGRES_DB}", "-c", "SELECT 1"]
19 changes: 3 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

x-postgres-vars: &postgres-vars
POSTGRES_DATABASE: spar
POSTGRES_DB: spar
POSTGRES_HOST: database
POSTGRES_USER: postgres
POSTGRES_PASSWORD: default
Expand All @@ -20,26 +20,19 @@ x-frontend: &frontend
VITE_ZONE: TEST
healthcheck:
test: timeout 10s bash -c 'true > /dev/tcp/127.0.0.1/3000'
interval: 10s
timeout: 10s
retries: 5
start_period: 10s

services:
database:
container_name: database
build: ./database
environment:
<<: *postgres-vars
volumes:
- "/pgdata"
- "./database/init_db:/init_db"
ports: ["5432:5432"]
healthcheck:
test: pg_isready -U postgres
interval: 5s
timeout: 5s
retries: 5
image: postgis/postgis:15-master
test: psql -q -U $${POSTGRES_USER} -d $${POSTGRES_DB} -c 'SELECT 1'

backend:
container_name: backend
Expand All @@ -63,9 +56,6 @@ services:
- $HOME/zscaler-certs:/certs
healthcheck:
test: curl -f http://localhost:8090/actuator/health | grep '"status":"UP"'
interval: 5s
timeout: 5s
retries: 5

frontend:
container_name: frontend
Expand Down Expand Up @@ -122,9 +112,6 @@ services:
volumes: ["./oracle-api:/app"]
healthcheck:
test: curl -f http://localhost:8091/actuator/health | grep '"status":"UP"'
interval: 5s
timeout: 5s
retries: 5

schemaspy:
container_name: schemaspy
Expand Down
2 changes: 1 addition & 1 deletion sync/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ objects:
key: oracle-user
- name: POSTGRES_HOST
value: ${REPO}-${ZONE}-database
- name: POSTGRES_DATABASE
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: ${REPO}-${ZONE}-database
Expand Down
4 changes: 2 additions & 2 deletions sync/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def generate_db_config(type_,schema_,settings):
"username": os.environ.get("POSTGRES_USER"),
"password": os.environ.get("POSTGRES_PASSWORD"),
"host": os.environ.get("POSTGRES_HOST"),
"database": os.environ.get("POSTGRES_DATABASE"),
"database": os.environ.get("POSTGRES_DB"),
"port": os.environ.get("POSTGRES_PORT"),
"schema": schema_,
"test_query": "SELECT 'SUCCESS' a",
Expand All @@ -60,7 +60,7 @@ def required_variables_exists():
not env_var_is_filled("POSTGRES_PORT") or \
not env_var_is_filled("POSTGRES_USER") or \
not env_var_is_filled("POSTGRES_PASSWORD") or \
not env_var_is_filled("POSTGRES_DATABASE") or \
not env_var_is_filled("POSTGRES_DB") or \
not env_var_is_filled("ORACLE_PORT") or \
not env_var_is_filled("ORACLE_HOST") or \
not env_var_is_filled("ORACLE_SERVICE") or \
Expand Down

0 comments on commit 5d82090

Please sign in to comment.