Files
2026-04-14 12:07:17 +10:00

50 lines
2.7 KiB
YAML

services:
mtls-bridge:
profiles: ["monitoring", "all", "mtls-bridge"]
build:
context: ${PROJECT_ROOT}/monitoring/mtls-bridge
container_name: mtls-bridge
hostname: mtls-bridge.lan.ddnsgeek.com
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:-}
- ALLOWED_PATHS_FILE=${MTLS_BRIDGE_ALLOWED_PATHS_FILE:-}
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}"
- "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,x-grafana-action,x-grafana-device-id"
- "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"
- "traefik.docker.network=core_traefik"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/_mtls_bridge/health', timeout=3).read()"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
networks:
- monitor
- traefik