telegram-antispam/Dockerfile
2026-02-27 11:53:47 +00:00

34 lines
638 B
Docker

# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /build
# Install build dependencies
RUN apk add --no-cache git
# Copy go mod files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source code
COPY . .
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o telegram-antiscam .
# Runtime stage
FROM alpine:latest
WORKDIR /app
# Install CA certificates for HTTPS
RUN apk add --no-cache ca-certificates
# Copy binary from builder
COPY --from=builder /build/telegram-antiscam .
# Run the bot with config path
ENTRYPOINT ["/app/telegram-antiscam"]
CMD ["/app/config.yaml"]