Added Squid Forward Proxy to Container

This commit is contained in:
Patrick Skowronek 2022-04-08 08:43:42 +02:00
parent cd149277ef
commit 900748b997
3 changed files with 56 additions and 6 deletions

View File

@ -1,8 +1,9 @@
version: "3.7" version: "3.7"
services: services:
### Does not need proxy settings
traefik: traefik:
container_name: bridgehead_traefik container_name: bridgehead-traefik
image: traefik:2.4 image: traefik:2.4
command: command:
- --api.insecure=true - --api.insecure=true
@ -24,9 +25,19 @@ services:
- ../auth/:/auth - ../auth/:/auth
extra_hosts: extra_hosts:
- "host.docker.internal:host-gateway" - "host.docker.internal:host-gateway"
### Does need to know the outside proxy to connect central components
forward_proxy:
container_name: bridgehead-squid
image: ubuntu/squid
environment:
http_proxy: ""
https_proxy: ""
## Needs internal proxy config
landing: landing:
container_name: bridgehead_landingpage container_name: bridgehead-landingpage
image: nginx:stable image: nginx:stable
volumes: volumes:
- ../landing/:/usr/share/nginx/html - ../landing/:/usr/share/nginx/html
@ -36,9 +47,10 @@ services:
- "traefik.http.services.landing.loadbalancer.server.port=80" - "traefik.http.services.landing.loadbalancer.server.port=80"
- "traefik.http.routers.landing.tls=true" - "traefik.http.routers.landing.tls=true"
## Needs internal proxy config
blaze: blaze:
image: "samply/blaze:0.16" image: "samply/blaze:0.16"
container_name: bridgehead_dktk_blaze container_name: bridgehead-dktk-blaze
environment: environment:
BASE_URL: "http://blaze:8080" BASE_URL: "http://blaze:8080"
JAVA_TOOL_OPTIONS: "-Xmx4g" JAVA_TOOL_OPTIONS: "-Xmx4g"
@ -55,7 +67,43 @@ services:
- "traefik.http.routers.blaze_dktk.middlewares=dktk_b_strip,test-auth" - "traefik.http.routers.blaze_dktk.middlewares=dktk_b_strip,test-auth"
- "traefik.http.routers.blaze_dktk.tls=true" - "traefik.http.routers.blaze_dktk.tls=true"
# dktk-fed-search-share: dktk-connector:
image: "samply/share-client:gbn-feature-environmentPreconfiguration"
environment:
POSTGRES_HOST: "dktk-connector-db"
POSTGRES_PASSWORD: "123"
STORE_URL: "http://bridgehead_blaze:8080/fhir"
MDR_URL: "https://mdr.ccp-it.dktk.dkfz.de/v3/api/mdr"
http_proxy: "http://squid:3128"
https_proxy: "http://squid:3128"
HTTP_PROXY: "http://squid:3128"
HTTP_PROXY: "http://squid:3128"
DEPLOYMENT_CONTEXT: "dktk-connector"
volumes:
- "dktk-connector-logs:/usr/local/tomcat/logs"
labels:
- "traefik.enable=true"
- "traefik.http.routers.dktk_connector.rule=PathPrefix(`/dktk-connector`)"
- "traefik.http.services.dktk_connector.loadbalancer.server.port=8080"
- "traefik.http.routers.landing.tls=true"
depends_on:
- "dktk-connector-db"
- "forward_proxy"
restart: "always"
dktk-connector-db:
image: "postgres:10.17"
environment:
POSTGRES_DB: "samply.connector"
POSTGRES_USER: "samply"
POSTGRES_PASSWORD: "123"
volumes:
- "dktk-connector-db-data:/var/lib/postgresql/data"
restart: "always"
# dktk-fed-search-share:
# image: "ghcr.io/samply/dktk-fed-search-share:pr-1" # image: "ghcr.io/samply/dktk-fed-search-share:pr-1"
# container_name: bridgehead_dktk_share # container_name: bridgehead_dktk_share
# environment: # environment:
@ -89,4 +137,6 @@ services:
volumes: volumes:
blaze-data: blaze-data:
dktk-connector-logs:
dktk-connector-db-data:
# dktk-fed-search-share-db-data: # dktk-fed-search-share-db-data:

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
cat > ../landing/index.html <<EOL cat > ./landing/index.html <<EOL
<html lang="en"> <html lang="en">
<head> <head>

View File

@ -4,7 +4,7 @@
## Check if user is a su ## Check if user is a su
echo "Welcome to the starting a bridgehead. We will get your instance up and running in no time" echo "Welcome to the starting a bridgehead. We will get your instance up and running in no time"
echo "First we will check if all prerequisites are met ..." echo "First we will check if all prerequisites are met ..."
prerequisites="git docker docker-compose cat" prerequisites="git docker docker-compose"
for prerequisite in $prerequisites; do for prerequisite in $prerequisites; do
$prerequisite --version 2>&1 $prerequisite --version 2>&1
is_available=$? is_available=$?