mirror of https://github.com/samply/bridgehead.git
Allow to run DNPM with Connect or with BWHC included
This commit is contained in:
parent
bece71441c
commit
3a5444dec0
|
@ -0,0 +1,29 @@
|
||||||
|
version: "3.7"
|
||||||
|
|
||||||
|
services:
|
||||||
|
beam-proxy:
|
||||||
|
environment:
|
||||||
|
APP_2_ID: dnpm
|
||||||
|
APP_2_KEY: ${DNPM_BEAM_SECRET_SHORT}
|
||||||
|
|
||||||
|
dnpm-beam-connect:
|
||||||
|
depends_on: [ beam-proxy ]
|
||||||
|
image: samply/beam-connect:sites-without-auth
|
||||||
|
environment:
|
||||||
|
PROXY_URL: http://beam-proxy:8081
|
||||||
|
PROXY_APIKEY: ${DNPM_BEAM_SECRET_SHORT}
|
||||||
|
APP_ID: dnpm.${PROXY_ID}
|
||||||
|
DISCOVERY_URL: ${DNPM_DISCOVERY_URL}
|
||||||
|
LOCAL_TARGETS_FILE: /run/secrets/connect_targets.json
|
||||||
|
HTTP_PROXY: http://forward_proxy:3128
|
||||||
|
HTTPS_PROXY: http://forward_proxy:3128
|
||||||
|
NO_PROXY: beam-proxy,dnpm-backend
|
||||||
|
RUST_LOG: ${RUST_LOG:-info}
|
||||||
|
secrets:
|
||||||
|
- connect_targets.json
|
||||||
|
ports:
|
||||||
|
- 8062:8062
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
connect_targets.json:
|
||||||
|
file: /etc/bridgehead/dnpm/local_targets.json
|
|
@ -0,0 +1,48 @@
|
||||||
|
version: "3.7"
|
||||||
|
|
||||||
|
services:
|
||||||
|
dnpm-frontend:
|
||||||
|
depends_on: [ dnpm-backend ]
|
||||||
|
build:
|
||||||
|
context: ./dnpm/origin
|
||||||
|
dockerfile: Frontend.Dockerfile
|
||||||
|
args:
|
||||||
|
NUXT_HOST: 0.0.0.0
|
||||||
|
NUXT_PORT: 3000
|
||||||
|
BACKEND_PROTOCOL: http
|
||||||
|
BACKEND_HOSTNAME: localhost
|
||||||
|
BACKEND_PORT: 9000
|
||||||
|
DNPM_BWHC_FRONTEND_ZIP: ${DNPM_BWHC_FRONTEND_ZIP}
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
||||||
|
environment:
|
||||||
|
BACKEND_PROTOCOL: http
|
||||||
|
BACKEND_HOSTNAME: localhost
|
||||||
|
BACKEND_PORT: 9000
|
||||||
|
no_proxy: dnpm-backend
|
||||||
|
|
||||||
|
dnpm-backend:
|
||||||
|
build:
|
||||||
|
context: ./dnpm/origin
|
||||||
|
dockerfile: Backend.Dockerfile
|
||||||
|
args:
|
||||||
|
BWHC_BASE_DIR: /bwhc-backend
|
||||||
|
DNPM_BWHC_BACKEND_ZIP: ${DNPM_BWHC_BACKEND_ZIP}
|
||||||
|
ports:
|
||||||
|
- 9000:9000
|
||||||
|
environment:
|
||||||
|
APPLICATION_SECRET: ${DNPM_APPLICATION_SECRET}
|
||||||
|
ZPM_SITE: ${ZPM_SITE}
|
||||||
|
noproxy: dnpm-frontend,connect
|
||||||
|
# PLAY_HTTP_PORT: 9000
|
||||||
|
# PLAY_HTTP_ADDRESS: 0.0.0.0
|
||||||
|
volumes:
|
||||||
|
- ./origin/logback.xml:/bwhc-backend/logback.xml:ro
|
||||||
|
- /etc/bridgehead/dnpm/bwhcConnectorConfig.xml:/bwhc-backend/bwhcConnectorConfig.xml:ro
|
||||||
|
- /etc/bridgehead/dnpm/production.conf:/bwhc-backend/production.conf:ro
|
||||||
|
- bwhc_data:/bwhc-backend/data/
|
||||||
|
- bwhc_hgnc_data:/bwhc-backend/hgnc_data/
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
bwhc_data:
|
||||||
|
bwhc_hgnc_data:
|
|
@ -1,104 +0,0 @@
|
||||||
version: "3.7"
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
connect_targets.json:
|
|
||||||
file: /etc/bridgehead/dnpm/local_targets.json
|
|
||||||
|
|
||||||
services:
|
|
||||||
# traefik:
|
|
||||||
# command:
|
|
||||||
# - --entrypoints.dnpm-frontend.address=:3000
|
|
||||||
# - --entrypoints.dnpm-backend.address=:9000
|
|
||||||
# ports:
|
|
||||||
# - 3000:3000
|
|
||||||
# - 9000:9000
|
|
||||||
beam-proxy:
|
|
||||||
environment:
|
|
||||||
APP_2_ID: dnpm
|
|
||||||
APP_2_KEY: ${DNPM_BEAM_SECRET_SHORT}
|
|
||||||
|
|
||||||
dnpm-beam-connect:
|
|
||||||
depends_on: [ beam-proxy ]
|
|
||||||
image: samply/beam-connect:sites-without-auth
|
|
||||||
environment:
|
|
||||||
PROXY_URL: http://beam-proxy:8081
|
|
||||||
PROXY_APIKEY: ${DNPM_BEAM_SECRET_SHORT}
|
|
||||||
APP_ID: dnpm.${PROXY_ID}
|
|
||||||
DISCOVERY_URL: ${DNPM_DISCOVERY_URL}
|
|
||||||
LOCAL_TARGETS_FILE: /run/secrets/connect_targets.json
|
|
||||||
HTTP_PROXY: http://forward_proxy:3128
|
|
||||||
HTTPS_PROXY: http://forward_proxy:3128
|
|
||||||
NO_PROXY: proxy,dnpm-backend
|
|
||||||
RUST_LOG: ${RUST_LOG:-info}
|
|
||||||
secrets:
|
|
||||||
- connect_targets.json
|
|
||||||
# Enable this if you disable the internal DNPM backend/frontend
|
|
||||||
# ports:
|
|
||||||
# - 8062:8062
|
|
||||||
# or the same via traefik:
|
|
||||||
# labels:
|
|
||||||
# - "traefik.enable=true"
|
|
||||||
# - "traefik.http.routers.connector.rule=PathPrefix(`/dnpm-connector`)"
|
|
||||||
# - "traefik.http.services.connector.loadbalancer.server.port=8062"
|
|
||||||
# - "traefik.http.routers.connector.tls=true"
|
|
||||||
|
|
||||||
dnpm-frontend:
|
|
||||||
depends_on: [ dnpm-backend ]
|
|
||||||
build:
|
|
||||||
context: ./dnpm/origin
|
|
||||||
dockerfile: Frontend.Dockerfile
|
|
||||||
args:
|
|
||||||
NUXT_HOST: 0.0.0.0
|
|
||||||
NUXT_PORT: 3000
|
|
||||||
BACKEND_PROTOCOL: http
|
|
||||||
BACKEND_HOSTNAME: localhost
|
|
||||||
BACKEND_PORT: 9000
|
|
||||||
DNPM_BWHC_FRONTEND_ZIP: ${DNPM_BWHC_FRONTEND_ZIP}
|
|
||||||
ports:
|
|
||||||
- 3000:3000
|
|
||||||
environment:
|
|
||||||
BACKEND_PROTOCOL: http
|
|
||||||
BACKEND_HOSTNAME: localhost
|
|
||||||
BACKEND_PORT: 9000
|
|
||||||
no_proxy: dnpm-backend
|
|
||||||
# labels:
|
|
||||||
# - "traefik.enable=true"
|
|
||||||
# - "traefik.http.routers.dnpm-frontend.entrypoints=dnpm-frontend"
|
|
||||||
# - "traefik.http.routers.dnpm-frontend.tls=true"
|
|
||||||
# - "traefik.http.services.dnpm-frontend.loadbalancer.server.port=3000"
|
|
||||||
## - "traefik.http.routers.dashboard.entrypoints=websecure"
|
|
||||||
## - "traefik.http.routers.dashboard.service=api@internal"
|
|
||||||
## - "traefik.http.routers.dashboard.tls=true"
|
|
||||||
## - "traefik.http.routers.dashboard.middlewares=auth"
|
|
||||||
## - "traefik.http.routers.dnpm-frontend.service=dnpm-frontend"
|
|
||||||
|
|
||||||
dnpm-backend:
|
|
||||||
build:
|
|
||||||
context: ./dnpm/origin
|
|
||||||
dockerfile: Backend.Dockerfile
|
|
||||||
args:
|
|
||||||
BWHC_BASE_DIR: /bwhc-backend
|
|
||||||
DNPM_BWHC_BACKEND_ZIP: ${DNPM_BWHC_BACKEND_ZIP}
|
|
||||||
ports:
|
|
||||||
- 9000:9000
|
|
||||||
environment:
|
|
||||||
APPLICATION_SECRET: ${DNPM_APPLICATION_SECRET}
|
|
||||||
ZPM_SITE: ${ZPM_SITE}
|
|
||||||
noproxy: dnpm-frontend,connect
|
|
||||||
# PLAY_HTTP_PORT: 9000
|
|
||||||
# PLAY_HTTP_ADDRESS: 0.0.0.0
|
|
||||||
volumes:
|
|
||||||
- ./origin/logback.xml:/bwhc-backend/logback.xml:ro
|
|
||||||
- /etc/bridgehead/dnpm/bwhcConnectorConfig.xml:/bwhc-backend/bwhcConnectorConfig.xml:ro
|
|
||||||
- /etc/bridgehead/dnpm/production.conf:/bwhc-backend/production.conf:ro
|
|
||||||
- bwhc_data:/bwhc-backend/data/
|
|
||||||
- bwhc_hgnc_data:/bwhc-backend/hgnc_data/
|
|
||||||
# labels:
|
|
||||||
# - "traefik.enable=true"
|
|
||||||
# - "traefik.http.routers.connector.rule=PathPrefix(`/dnpm-backend`)"
|
|
||||||
# - "traefik.http.services.connector.loadbalancer.server.port=9000"
|
|
||||||
# - "traefik.http.routers.connector.tls=true"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
bwhc_data:
|
|
||||||
bwhc_hgnc_data:
|
|
|
@ -2,10 +2,14 @@
|
||||||
|
|
||||||
function dnpmSetup() {
|
function dnpmSetup() {
|
||||||
if [ -e /etc/bridgehead/dnpm/local_targets.json ]; then
|
if [ -e /etc/bridgehead/dnpm/local_targets.json ]; then
|
||||||
log INFO "DNPM setup detected -- will start DNPM Connector."
|
log INFO "DNPM setup detected (Beam.Connect) -- will start Beam.Connect for DNPM."
|
||||||
source /etc/bridgehead/dnpm/shared-but-secret-vars || fail_and_report 1 "Unable to load /etc/bridgehead/dnpm/shared-but-secret-vars"
|
OVERRIDE+=" -f ./dnpm/dnpm-compose-beamconnect.yml"
|
||||||
OVERRIDE+="-f ./dnpm/dnpm-compose.yml"
|
|
||||||
DNPM_APPLICATION_SECRET="$(echo \"This is a salt string to generate one consistent password. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
|
DNPM_APPLICATION_SECRET="$(echo \"This is a salt string to generate one consistent password. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
|
||||||
DNPM_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
|
DNPM_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
|
||||||
|
if [ -e /etc/bridgehead/dnpm/bwhcConnectorConfig.xml ]; then
|
||||||
|
log INFO "DNPM setup detected (with Frontend/Backend) -- will start BWHC Frontend/Backend."
|
||||||
|
source /etc/bridgehead/dnpm/shared-but-secret-vars || fail_and_report 1 "Unable to load /etc/bridgehead/dnpm/shared-but-secret-vars"
|
||||||
|
OVERRIDE+=" -f ./dnpm/dnpm-compose-bwhc.yml"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue