-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment
github-actions[bot] edited this page May 9, 2026
·
2 revisions
The simplest production deployment. Secrets stay in your host-side .env and are injected at runtime.
docker compose up -dThe compose.yml configures:
-
env_file: .envfor secret injection (never baked into the image) -
squawk_datanamed volume mounted at/app/datafor persistent state -
restart: unless-stoppedfor automatic recovery
State survives container restarts, recreations, and image updates (e.g., via Watchtower or WUD).
Build:
docker build -t squawk .Run:
docker run --rm --env-file .env -v squawk_data:/app/data squawkA multi-arch image (ARM64 + AMD64) is published to GitHub Container Registry on every push to main:
docker pull ghcr.io/anthonybaldwin/squawk:latestTags:
-
latest— current main branch -
1.0.<run_number>— incremental build number -
v*semver tags (when git-tagged) -
sha-<commit>— exact commit
Triggers on push to main or v* tags when source files change:
-
src/**,Dockerfile,.dockerignore,package.json,bun.lock,tsconfig.json
Steps:
- Checkout
- Setup QEMU + Buildx (multi-platform)
- Login to GHCR
- Generate metadata tags
- Build and push for
linux/arm64andlinux/amd64
Concurrency: cancels previous runs on the same branch.
When Dependabot opens a PR that changes package.json, this workflow automatically regenerates bun.lock and commits it back.
Weekly updates for:
- npm dependencies (grouped)
- Docker base images
- GitHub Actions (grouped)
FROM oven/bun:1.3.10-alpine
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile --production
COPY src ./src
CMD ["bun", "src/index.ts"]- Alpine base for minimal image size
- Frozen lockfile ensures reproducible builds
- Production flag skips devDependencies
- Only
src/is copied (no dev files, docs, or tests)
-
Secrets: Never bake
.envor tokens into the Docker image. Useenv_fileor environment variables at runtime. -
State volume: Always mount
data/as a persistent volume. Without it, the bot will re-seed on every restart and may re-post updates. - Polling interval: The default 60s is a good balance. Lower intervals increase API load; higher intervals delay notifications.
- Multiple instances: Do not run multiple instances against the same Discord channel. They will fight over thread ownership and duplicate posts.
-
Logging: The bot logs to stdout. Use
docker logsor your container orchestrator's logging to monitor health.