Lesson 3.5: Deployment patterns
Difficulty: Intermediate | Duration: 12 min | Prerequisites: Lesson 3.1
Overview
Ship the bowire CLI into a non-laptop environment — an internal-tools container, a CI runner, a sidecar — and keep it configured across layers.
Layered configuration
Bowire reads settings in standard .NET precedence — later layers win:
appsettings.jsonsections (Bowire:Mock,Bowire:Cli,Bowire:Test,Bowire:Plugin, …)BOWIRE_*environment variables- CLI flags
// appsettings.json
{ "Bowire": { "Mock": { "Port": 6000 }, "PluginUpdateCheck": { "Enabled": false } } }
BOWIRE_Bowire__Mock__Port=7000 bowire mock rec.bwr # env overrides appsettings
bowire mock rec.bwr --port 8000 # flag overrides both
Container
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
RUN dotnet tool install --global Kuestenlogik.Bowire.Tool
ENV PATH="$PATH:/root/.dotnet/tools"
ENTRYPOINT ["bowire", "mock", "/data/recording.bwr", "--host", "0.0.0.0", "--port", "6000"]
Bind --host 0.0.0.0 so the mock is reachable outside the container; mount recordings/workspaces as volumes.
systemd (host the CLI as a service)
# /etc/systemd/system/bowire-mock.service
[Service]
ExecStart=/usr/local/bin/bowire mock /srv/bowire/recording.bwr --host 0.0.0.0 --port 6000
Restart=always
Environment=BOWIRE_PluginUpdateCheck__Enabled=false
[Install]
WantedBy=multi-user.target
Reverse-proxy in front
Terminate TLS and route at nginx/Traefik; Bowire listens plain on the loopback/pod-internal port. Lock the workbench URL in shared deploys with --lock-server-url, and gate the workbench out of production builds (embedded hosts: wrap AddBowire()/MapBowire() in IsDevelopment() — see Unit 4).
Key Takeaways
- Config layers:
appsettings.json→BOWIRE_*env → CLI flags (later wins). - Containerise the global tool with
--host 0.0.0.0and volume-mounted recordings. - Front it with a reverse-proxy for TLS; keep update-checks/telemetry opt-in for shared installs.
What's Next
Continue: → Lesson 3.6: Observability & operations