1
0
mirror of https://github.com/taigrr/pastebin synced 2026-04-05 02:42:30 -07:00
Files
pastebin/Dockerfile
Tai Groot 02d3bc9aa5 fix: improve correctness and safety
- 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
2026-03-09 05:45:03 +00:00

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