16 lines
375 B
Docker
16 lines
375 B
Docker
# Stage 1: Build
|
|
FROM golang:1.22-alpine AS builder
|
|
WORKDIR /build
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /bot ./cmd/bot
|
|
|
|
# Stage 2: Runtime
|
|
FROM alpine:3.19
|
|
RUN apk add --no-cache ffmpeg ca-certificates tzdata
|
|
COPY --from=builder /bot /bot
|
|
RUN adduser -D -u 1001 botuser
|
|
USER botuser
|
|
ENTRYPOINT ["/bot"]
|