- egress-proxy gets a fixed IP (172.28.5.10) on a new 172.28.5.0/24 subnet for the 'egress' network. - sde-meeting-toolkit gets a static extra_hosts entry for 'egress-proxy' instead of relying on Docker's embedded DNS, which breaks for internal-network names on a container that's also on a normal network (confirmed via a real smoke test run - EAI_AGAIN). - Update CHANGELOG with the root cause and the subnet-collision caveat.
98 lines
3.9 KiB
YAML
98 lines
3.9 KiB
YAML
# Standalone compose file for this tool.
|
|
#
|
|
# Network layout:
|
|
# - "proxy": external, owned by Nginx Proxy Manager's own stack. Lets NPM
|
|
# reach sde-meeting-toolkit by container name. No internet route.
|
|
# - "egress": private to this compose file. The ONLY thing
|
|
# sde-meeting-toolkit can reach besides "proxy". Used to talk to the
|
|
# egress-proxy container below.
|
|
# - "default": Compose's own auto-created network. Only egress-proxy is on
|
|
# it, since it's the only container here that needs real internet access.
|
|
#
|
|
# sde-meeting-toolkit itself is NOT on "default" and has no direct route to
|
|
# the internet at all. Its one outbound call (the AI draft button, to
|
|
# api.anthropic.com) is routed through egress-proxy via EGRESS_PROXY_URL,
|
|
# which only forwards that one destination and refuses everything else
|
|
# (see egress-proxy/tinyproxy.conf and egress-proxy/filter). A compromised
|
|
# app container still can't reach anything but Anthropic's API.
|
|
services:
|
|
sde-meeting-toolkit:
|
|
build: .
|
|
container_name: sde-meeting-toolkit
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5173:5173"
|
|
environment:
|
|
- MOCK_AI=${MOCK_AI:-false}
|
|
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
|
|
- EGRESS_PROXY_URL=${EGRESS_PROXY_URL:-http://egress-proxy:8888}
|
|
- APP_USERS=${APP_USERS:-}
|
|
- APP_USERNAME=${APP_USERNAME:-}
|
|
- APP_PASSWORD=${APP_PASSWORD:-}
|
|
- RATE_LIMIT_MAX=${RATE_LIMIT_MAX:-20}
|
|
- RATE_LIMIT_WINDOW_MS=${RATE_LIMIT_WINDOW_MS:-300000}
|
|
- LOGIN_ATTEMPT_MAX=${LOGIN_ATTEMPT_MAX:-10}
|
|
- LOGIN_ATTEMPT_WINDOW_MS=${LOGIN_ATTEMPT_WINDOW_MS:-600000}
|
|
- LOGIN_LOCKOUT_MS=${LOGIN_LOCKOUT_MS:-900000}
|
|
- AUTH_LOG_FILE=${AUTH_LOG_FILE:-./data/auth-log.jsonl}
|
|
- SIGNIN_LOG_DEBOUNCE_MS=${SIGNIN_LOG_DEBOUNCE_MS:-1800000}
|
|
- TOKEN_LIMIT_PER_USER=${TOKEN_LIMIT_PER_USER:-0}
|
|
- TOKEN_USAGE_FILE=${TOKEN_USAGE_FILE:-./data/token-usage.json}
|
|
volumes:
|
|
# Persists the per-user token quota file across restarts and rebuilds.
|
|
# Without this, everyone's daily usage silently resets on every deploy.
|
|
- ./data:/app/data
|
|
networks:
|
|
- proxy
|
|
- egress
|
|
# A container attached to both a normal network ("proxy") and an
|
|
# internal: true network ("egress") can hit a real Docker bug where
|
|
# embedded DNS stops resolving names on the internal side (EAI_AGAIN),
|
|
# confirmed while testing this. Sidestep it with a static hosts entry
|
|
# instead of relying on DNS for this one name - egress-proxy's fixed
|
|
# IP is set below via ipv4_address.
|
|
extra_hosts:
|
|
- "egress-proxy:172.28.5.10"
|
|
depends_on:
|
|
- egress-proxy
|
|
# Hardening for a container that's reachable from the public internet
|
|
# (through Nginx Proxy Manager). Neither of these needs any Linux
|
|
# capability the app doesn't already have, and the app never needs to
|
|
# escalate privilege.
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
|
|
egress-proxy:
|
|
build: ./egress-proxy
|
|
container_name: sde-meeting-toolkit-egress-proxy
|
|
restart: unless-stopped
|
|
networks:
|
|
egress:
|
|
# Fixed IP so sde-meeting-toolkit can reach this by static hosts
|
|
# entry (extra_hosts above) instead of DNS, working around the
|
|
# internal-network DNS bug. Must match that entry if ever changed.
|
|
ipv4_address: 172.28.5.10
|
|
default: {}
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
|
|
networks:
|
|
proxy:
|
|
external: true
|
|
egress:
|
|
driver: bridge
|
|
# Without this, Docker still gives this network a NAT route to the
|
|
# public internet (every bridge network gets one by default, "default"
|
|
# isn't special) - which defeats the whole point. internal: true means
|
|
# nothing on this network, including sde-meeting-toolkit, has any route
|
|
# out except through egress-proxy, which also sits on "default" and IS
|
|
# meant to have one.
|
|
internal: true
|
|
ipam:
|
|
config:
|
|
- subnet: 172.28.5.0/24
|