diff --git a/.github/workflows/bld_docker.yml b/.github/workflows/bld_docker.yml index e1fd22d548..db63fd4fd8 100644 --- a/.github/workflows/bld_docker.yml +++ b/.github/workflows/bld_docker.yml @@ -106,6 +106,10 @@ jobs: docker_name: orcid/registry/orcid-web-proxy file: orcid-web-proxy/Dockerfile + - artifact_name: orcid-haprouter + docker_name: orcid/registry/orcid-haprouter + file: orcid-haprouter/Dockerfile + runs-on: ubuntu-latest steps: - name: git-checkout-ref-action diff --git a/docker-compose.yml b/docker-compose.yml index df203b5771..81746d623a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,13 +9,7 @@ services: profiles: - build networks: - custom_network: - ipv4_address: 10.20.0.2 - extra_hosts: - - "dependencies:10.20.0.2" - - "redis:10.20.0.3" - - "postgres:10.20.0.4" - - "haprouter:10.20.0.5" + app: redis: image: orcid/registry/redis:7.2.5-alpine @@ -28,13 +22,7 @@ services: - db - dev networks: - custom_network: - ipv4_address: 10.20.0.3 - extra_hosts: - - "dependencies:10.20.0.2" - - "redis:10.20.0.3" - - "postgres:10.20.0.4" - - "haprouter:10.20.0.5" + app: postgres: image: postgres:13.13-alpine3.19 @@ -51,49 +39,27 @@ services: - db - dev networks: - custom_network: - ipv4_address: 10.20.0.4 - extra_hosts: - - "dependencies:10.20.0.2" - - "redis:10.20.0.3" - - "postgres:10.20.0.4" - - "haprouter:10.20.0.5" + app: haprouter: image: ${DOCKER_REG_PRIVATE}/orcid/registry/orcid-haprouter:${TAG:-0.0.1} build: context: . dockerfile: orcid-haprouter/Dockerfile - extra_hosts: - - "nowhere:127.0.0.1" - - "dependencies:10.20.0.2" - - "redis:10.20.0.3" - - "postgres:10.20.0.4" - - "haprouter:10.20.0.5" - environment: - POSTGRES_READ_FQDN_A: postgres - POSTGRES_READ_FQDN_B: nowhere - POSTGRES_READ_FQDN_C: nowhere - POSTGRES_WRITE_FQDN_A: postgres - POSTGRES_WRITE_FQDN_B: nowhere - POSTGRES_WRITE_FQDN_C: nowhere - SOLR_READ_FQDN_A: solr - SOLR_READ_FQDN_B: nowhere - SOLR_READ_FQDN_C: nowhere - SOLR_WRITE_FQDN_A: solr - SOLR_WRITE_FQDN_B: nowhere.local - SOLR_WRITE_FQDN_C: nowhere.local + env_file: + - orcid-haprouter/default.env + - orcid-haprouter/deployment.env ports: - 0.0.0.0:8888:1936 # stats - - 0.0.0.0:7432:7432 # solr read - - 0.0.0.0:7983:7983 # solr write + - 0.0.0.0:7983:7983 # solr read + - 0.0.0.0:6983:6983 # solr write - 0.0.0.0:7432:7432 # postgres read - 0.0.0.0:6432:6432 # postgres write networks: - custom_network: - ipv4_address: 10.20.0.5 + app: profiles: - dev + - ui lb: image: ${DOCKER_REG_PRIVATE}/orcid/registry/orcid-lb:${TAG:-0.0.1} @@ -101,8 +67,11 @@ services: context: . dockerfile: orcid-lb/Dockerfile ports: + - 0.0.0.0:9999:1936 # stats - 0.0.0.0:80:80 - 0.0.0.0:443:443 + networks: + app: profiles: - dev @@ -116,6 +85,8 @@ services: profiles: - dev - ui + networks: + app: web_proxy: image: ${DOCKER_REG_PRIVATE}/orcid/registry/orcid-web-proxy:${TAG:-0.0.1} @@ -129,6 +100,8 @@ services: - ./certs/dhparam.pem:/etc/nginx/certs/dhparam.pem:ro - ${SSL_CERTIFICATE:-./certs/docker_dev.pem}:/etc/nginx/certs/docker.pem:ro - ${SSL_CERTIFICATE_KEY:-./certs/docker_dev-key.pem}:/etc/nginx/certs/docker-key.pem:ro + networks: + app: profiles: - dev - ui @@ -153,16 +126,15 @@ services: - ${DOCKER_DEV_ENV_FILE:-empty.env} ports: - 0.0.0.0:13100:8080 + networks: + app: profiles: - dev - ui networks: - custom_network: + app: driver: bridge - ipam: - config: - - subnet: 10.20.0.0/16 volumes: postgres_data: diff --git a/docker-entrypoint-initdb.d/1-dev-users.sql b/docker-entrypoint-initdb.d/1-dev-users.sql index 2b44dd0fba..300f27b142 100644 --- a/docker-entrypoint-initdb.d/1-dev-users.sql +++ b/docker-entrypoint-initdb.d/1-dev-users.sql @@ -2,4 +2,5 @@ CREATE USER orcid WITH PASSWORD 'orcid'; CREATE USER statistics WITH PASSWORD 'statistics'; CREATE USER orcidro WITH PASSWORD 'orcidro'; CREATE USER dw_user WITH PASSWORD 'dw_user'; +CREATE USER pgc WITH PASSWORD 'pgc'; diff --git a/docker-entrypoint-initdb.d/2-pgc-allow.sh b/docker-entrypoint-initdb.d/2-pgc-allow.sh new file mode 100644 index 0000000000..0b44cf6d25 --- /dev/null +++ b/docker-entrypoint-initdb.d/2-pgc-allow.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "host template1 pgc 0.0.0.0/0 trust" >> /var/lib/postgresql/data/pg_hba.conf + diff --git a/docker-up.sh b/docker-up.sh new file mode 100755 index 0000000000..61e2b54f4e --- /dev/null +++ b/docker-up.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +docker compose --profile db up -d + +sleep 20 + +docker compose --profile dev up -d diff --git a/orcid-haprouter/default.env b/orcid-haprouter/default.env new file mode 100644 index 0000000000..87a0fe519c --- /dev/null +++ b/orcid-haprouter/default.env @@ -0,0 +1,12 @@ +POSTGRES_READ_FQDN_A=postgres +POSTGRES_READ_FQDN_B=localhost +POSTGRES_READ_FQDN_C=localhost +POSTGRES_WRITE_FQDN_A=postgres +POSTGRES_WRITE_FQDN_B=localhost +POSTGRES_WRITE_FQDN_C=localhost +SOLR_READ_FQDN_A=solr +SOLR_READ_FQDN_B=localhost +SOLR_READ_FQDN_C=localhost +SOLR_WRITE_FQDN_A=solr +SOLR_WRITE_FQDN_B=localhost +SOLR_WRITE_FQDN_C=localhost diff --git a/orcid-haprouter/deployment.env b/orcid-haprouter/deployment.env new file mode 100644 index 0000000000..34094e6dbf --- /dev/null +++ b/orcid-haprouter/deployment.env @@ -0,0 +1 @@ +# empty file that is written out by deployment systems diff --git a/properties/default.persistence.env b/properties/default.persistence.env index 6569d2ea09..a900ec5bb4 100644 --- a/properties/default.persistence.env +++ b/properties/default.persistence.env @@ -24,11 +24,11 @@ ORG_ORCID_PERSISTENCE_DB_READONLY_PASSWORD=orcidro ORG_ORCID_PERSISTENCE_DB_READONLY_PREFERRED_TEST_QUERY=select 1 ORG_ORCID_PERSISTENCE_DB_READONLY_SHOW_SQL="false" ORG_ORCID_PERSISTENCE_DB_READONLY_TEST_CONNECTION_ON_CHECKIN="true" -ORG_ORCID_PERSISTENCE_DB_READONLY_URL=jdbc:postgresql://postgres:5432/orcid +ORG_ORCID_PERSISTENCE_DB_READONLY_URL=jdbc:postgresql://haprouter:7432/orcid ORG_ORCID_PERSISTENCE_DB_READONLY_USERNAME=orcidro ORG_ORCID_PERSISTENCE_DB_SHOW_SQL="false" ORG_ORCID_PERSISTENCE_DB_TEST_CONNECTION_ON_CHECKIN="true" -ORG_ORCID_PERSISTENCE_DB_URL=jdbc:postgresql://postgres:5432/orcid +ORG_ORCID_PERSISTENCE_DB_URL=jdbc:postgresql://haprouter:6432/orcid ORG_ORCID_PERSISTENCE_DB_USERNAME=orcid ORG_ORCID_PERSISTENCE_INTERNAL_API_DB_INITIAL_POOL_SIZE="1" ORG_ORCID_PERSISTENCE_INTERNAL_API_DB_MAX_POOL_SIZE="3" @@ -43,7 +43,7 @@ ORG_ORCID_PERSISTENCE_LIQUIBASE_ENABLED="false" ORG_ORCID_PERSISTENCE_SOLR_ALLOW_COMPRESSION="true" ORG_ORCID_PERSISTENCE_SOLR_CONNECTION_TIMEOUT="60000" ORG_ORCID_PERSISTENCE_SOLR_MAX_RETRIES="1" -ORG_ORCID_PERSISTENCE_SOLR_READ_ONLY_URL=http://solr/solr +ORG_ORCID_PERSISTENCE_SOLR_READ_ONLY_URL=http://haprouter:7983/solr ORG_ORCID_PERSISTENCE_TOGGLZ_CACHE_TTL="60000" ORG_ORCID_PERSISTENCE_TOGGLZ_DB_CLASS=org.postgresql.Driver ORG_ORCID_PERSISTENCE_TOGGLZ_DB_IDLE_CONNECTION_TEST_PERIOD="60" @@ -55,7 +55,7 @@ ORG_ORCID_PERSISTENCE_TOGGLZ_DB_NUM_HELPER_THREADS="5" ORG_ORCID_PERSISTENCE_TOGGLZ_DB_PASSWORD=orcid ORG_ORCID_PERSISTENCE_TOGGLZ_DB_PREFERRED_TEST_QUERY=select 1 ORG_ORCID_PERSISTENCE_TOGGLZ_DB_TEST_CONNECTION_ON_CHECKIN="true" -ORG_ORCID_PERSISTENCE_TOGGLZ_DB_URL=jdbc:postgresql://postgres:5432/features +ORG_ORCID_PERSISTENCE_TOGGLZ_DB_URL=jdbc:postgresql://haprouter:6432/features ORG_ORCID_PERSISTENCE_TOGGLZ_DB_USERNAME=orcid # sched ones