max-telegram-bridge-bot/Dockerfile
Andrey Lugovskoy 62a4233027 Security hardening and admin check tests
- Webhook paths now include token-derived secret (prevents spoofed updates)
- HTTP server with Read/Write/Idle timeouts (prevents slowloris)
- Shared HTTP client with 60s timeout for all uploads/downloads
- Removed tokens and sensitive data from debug logs
- Retry loop respects context cancellation instead of blocking sleep
- Pending bridge keys expire after 1 hour (migration 000003)
- Increased bridge key entropy from 32 to 64 bits (16 hex chars)
- Docker container runs as non-root user
- Extracted admin check helpers with unit tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 15:05:41 +03:00

21 lines
433 B
Docker

FROM golang:1.24-alpine AS builder
RUN apk add --no-cache gcc musl-dev
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 go build -o /max-telegram-bridge-bot .
FROM alpine:3.21
RUN apk add --no-cache ca-certificates
RUN adduser -D -h /app bridge
USER bridge
WORKDIR /app
COPY --from=builder /max-telegram-bridge-bot /usr/local/bin/max-telegram-bridge-bot
ENTRYPOINT ["max-telegram-bridge-bot"]