Skip to content

Install with Docker

alsi-lawr edited this page Jul 21, 2026 · 2 revisions

Install with Docker

The repository contains a multi-stage Dockerfile that builds the frontend, publishes BlokeBot, and runs it as a non-root user.

Build

From the repository root:

docker build --file packaging/docker/blokebot.Dockerfile --tag blokebot .

The build uses the locked npm graph, .NET SDK 10.0.301, and ASP.NET 10 runtime.

Configure

Create a private environment file:

TwitchBot__Identity__BotUsername=my-bot
TwitchBot__Identity__ClientId=public-client-id
TwitchBot__Identity__ClientSecret=private-client-secret
TwitchBot__Identity__RedirectUri=https://bot.example.com/oauth/callback
chmod 600 blokebot.env

See Twitch identity and OAuth for redirect and scope details. Custom-bot encryption needs no environment settings or secret file.

Run

docker run --rm --init \
  --publish 8080:8080 \
  --volume blokebot-data:/data \
  --env-file blokebot.env \
  blokebot

Open http://localhost:8080.

Runtime contract

  • BlokeBot listens on port 8080.
  • SQLite state is stored at /data/blokebot.db.
  • The main-bot OAuth token cache is stored at /data/twitch.tokens.json.
  • Custom-bot Data Protection keys are created and persisted automatically under private /data state.
  • The default process identity is the image's non-root app user.
  • /data is declared as a volume, but you must name or bind storage if its lifecycle must outlive the container.
  • Production configuration may also be mounted at /app/appsettings.Production.json.

The image explicitly configures /data as application state, so a different --data-dir does not move it. Back up the complete volume from a stopped container or one consistent snapshot; see State and secrets.

Clone this wiki locally