Docker
Laserbeak includes a multi-stage Dockerfile and a docker-compose file for easy deployment.
Docker Compose (recommended)
- Create a
.envfile with your tokens:
cp .env.example .env
# Edit .env with your values
- Start the bot:
make docker-up
Or without Make:
docker compose up -d
- View logs:
docker compose logs -f laserbeak
- Stop the bot:
make docker-down
Dockerfile
The Dockerfile uses a multi-stage build:
- Build stage (
golang:1.24-bookworm) — installs libopus, downloads Go dependencies, compiles the binary - Runtime stage (
debian:bookworm-slim) — minimal image with only the binary and runtime libraries
# Build stage
FROM golang:1.24-bookworm AS builder
RUN apt-get update && apt-get install -y libopus-dev libopusfile-dev pkg-config gcc
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 go build -o /bin/laserbeak .
# Runtime stage
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y libopus0 libopusfile0 ca-certificates
COPY --from=builder /bin/laserbeak /usr/local/bin/laserbeak
CMD ["laserbeak", "serve"]
docker-compose.yml
services:
laserbeak:
build: .
env_file: .env
restart: on-failure
Configuration is passed via the .env file using LASERBEAK_ prefixed environment variables. See Configuration for all available settings.