47 lines
2.5 KiB
YAML
47 lines
2.5 KiB
YAML
services:
|
|
mtls-bridge:
|
|
profiles: ["monitoring", "all", "mtls-bridge"]
|
|
build:
|
|
context: ${PROJECT_ROOT}/monitoring/mtls-bridge
|
|
container_name: mtls-bridge
|
|
restart: unless-stopped
|
|
environment:
|
|
- TARGET_URL=${MTLS_BRIDGE_TARGET_URL}
|
|
- CLIENT_CERT=${MTLS_BRIDGE_CLIENT_CERT}
|
|
- CLIENT_KEY=${MTLS_BRIDGE_CLIENT_KEY}
|
|
- TIMEOUT=${MTLS_BRIDGE_TIMEOUT}
|
|
- LOG_LEVEL=${MTLS_BRIDGE_LOG_LEVEL:-INFO}
|
|
- UPSTREAM_CA_CERT=${MTLS_BRIDGE_UPSTREAM_CA_CERT:-}
|
|
volumes:
|
|
- ${PROJECT_ROOT}/core/traefik/certs:/certs:ro
|
|
labels:
|
|
- "traefik.http.routers.mtls-bridge.rule=Host(`mtls-bridge.lan.ddnsgeek.com`)"
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.mtls-bridge.entrypoints=websecure"
|
|
- "traefik.http.routers.mtls-bridge.tls.certresolver=myresolver"
|
|
- "traefik.http.routers.mtls-bridge.middlewares=mtls-bridge-auth,mtls-bridge-cors"
|
|
- "traefik.http.middlewares.mtls-bridge-auth.basicauth.users=${MTLS_BRIDGE_BASIC_AUTH_USERS}"
|
|
- "traefik.http.routers.mtls-bridge-preflight.rule=Host(`mtls-bridge.lan.ddnsgeek.com`) && Method(`OPTIONS`)"
|
|
- "traefik.http.routers.mtls-bridge-preflight.entrypoints=websecure"
|
|
- "traefik.http.routers.mtls-bridge-preflight.tls.certresolver=myresolver"
|
|
- "traefik.http.routers.mtls-bridge-preflight.middlewares=mtls-bridge-cors"
|
|
- "traefik.http.routers.mtls-bridge-preflight.priority=100"
|
|
- "traefik.http.routers.mtls-bridge-preflight.service=mtls-bridge"
|
|
- "traefik.http.middlewares.mtls-bridge-cors.headers.accesscontrolalloworiginlist=${MTLS_BRIDGE_CORS_ALLOW_ORIGIN:-https://grafana.lan.ddnsgeek.com}"
|
|
- "traefik.http.middlewares.mtls-bridge-cors.headers.accesscontrolallowmethods=GET,POST,PUT,PATCH,DELETE,OPTIONS"
|
|
- "traefik.http.middlewares.mtls-bridge-cors.headers.accesscontrolallowheaders=Authorization,Content-Type"
|
|
- "traefik.http.middlewares.mtls-bridge-cors.headers.accesscontrolallowcredentials=true"
|
|
- "traefik.http.middlewares.mtls-bridge-cors.headers.addvaryheader=true"
|
|
- "io.portainer.accesscontrol.public"
|
|
# - "traefik.http.routers.searxng.middlewares=crowdsec@file,secHeaders@file,error-pages-middleware"
|
|
- "traefik.http.services.mtls-bridge.loadbalancer.server.port=8080"
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/health', timeout=3).read()"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 10s
|
|
networks:
|
|
- monitor
|
|
- traefik
|