mirror of
https://github.com/taigrr/pastebin
synced 2026-04-05 02:42:30 -07:00
- Add MaxBytesReader to limit paste body size (1 MB) - Buffer template output before writing to prevent partial responses - Add paste ID collision retry logic - Update Dockerfile to use modern multi-stage build (remove go.rice) - Update Makefile to use direct go build commands - Add test for oversized paste rejection
19 lines
272 B
Docker
19 lines
272 B
Docker
FROM golang:alpine AS builder
|
|
|
|
RUN apk add --no-cache git
|
|
|
|
WORKDIR /src
|
|
COPY . .
|
|
|
|
RUN go build -o /pastebin .
|
|
RUN go build -o /pb ./cmd/pb/
|
|
|
|
|
|
FROM alpine
|
|
|
|
EXPOSE 8000/tcp
|
|
ENTRYPOINT ["pastebin"]
|
|
|
|
COPY --from=builder /pastebin /bin/pastebin
|
|
COPY --from=builder /pb /bin/pb
|