diff --git a/Makefile b/Makefile index 16bf963..f5b09af 100644 --- a/Makefile +++ b/Makefile @@ -123,11 +123,13 @@ push-scanner: # Development env based on Docker/Podman Compose tool start-dev: @echo "### [Starting dev environment] ###" - @$(CONTAINER_ENGINE)-compose -f $(DEPLOYMENTS_DIR)/docker-compose/docker-compose.yaml up -d + @$(CONTAINER_ENGINE)-compose -f $(DEPLOYMENTS_DIR)/compose/compose-devel.yaml up -d stop-dev: @echo "### [Stopping dev environment] ###" - @$(CONTAINER_ENGINE)-compose -f $(DEPLOYMENTS_DIR)/docker-compose/docker-compose.yaml down + @$(CONTAINER_ENGINE)-compose -f $(DEPLOYMENTS_DIR)/compose/compose-devel.yaml down + +restart-dev: stop-dev start-dev init-psql-test-data: export PGPASSWORD=password ; psql -h localhost -p 5432 -U user -d clusteriq < db/sql/test_data.sql diff --git a/deployments/docker-compose/docker-compose.yaml b/deployments/compose/compose-devel.yaml similarity index 75% rename from deployments/docker-compose/docker-compose.yaml rename to deployments/compose/compose-devel.yaml index 8f5222d..ba1b573 100644 --- a/deployments/docker-compose/docker-compose.yaml +++ b/deployments/compose/compose-devel.yaml @@ -1,23 +1,12 @@ version: "3.7" services: - console: - image: quay.io/ecosystem-appeng/cluster-iq-console:latest - container_name: console - restart: always - depends_on: - api: - condition: service_healthy - ports: - - 8080:3000 - environment: - REACT_APP_CIQ_API_URL: "http://api:8080" api: image: quay.io/ecosystem-appeng/cluster-iq-api:latest container_name: api restart: always depends_on: init-pgsql: - condition: service_healthy + condition: service_completed_successfully ports: - 8081:8080 environment: @@ -29,6 +18,9 @@ services: image: quay.io/ecosystem-appeng/cluster-iq-scanner:latest container_name: scanner restart: "no" + depends_on: + api: + condition: service_started environment: CIQ_API_URL: "http://api:8080/api/v1" CIQ_CREDS_FILE: "/credentials" @@ -49,7 +41,7 @@ services: POSTGRESQL_ADMIN_PASSWORD: "admin" healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] - interval: 5s + interval: 15s timeout: 5s retries: 5 @@ -58,7 +50,9 @@ services: container_name: init-pgsql restart: "no" command: | - sh -c 'while true; do psql postgresql://user:password@pgsql:5432/clusteriq -c "SELECT true" && break || sleep 2; done; psql postgresql://user:password@pgsql:5432/clusteriq < /init.sql' + sh -c ' while true; do psql postgresql://user:password@pgsql:5432/clusteriq -c "SELECT true" && break || sleep 2 done + psql postgresql://user:password@pgsql:5432/clusteriq < /init.sql && { echo "Ok"; } || { echo "Initialization Failed"; exit 1; } + ' volumes: - ./../../db/sql/init.sql:/init.sql depends_on: diff --git a/deployments/containerfiles/Containerfile-api b/deployments/containerfiles/Containerfile-api index 34f4fa5..525c8b3 100644 --- a/deployments/containerfiles/Containerfile-api +++ b/deployments/containerfiles/Containerfile-api @@ -11,7 +11,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o cluster-iq-api -ldflags "- ## Run #################### -FROM registry.access.redhat.com/ubi8/ubi-micro:8.8-5 +FROM registry.access.redhat.com/ubi8/ubi-micro:8.10-15 # Labels LABEL version="v0.2"