mirror of
https://github.com/skidoodle/pastebin
synced 2025-10-14 09:44:48 +02:00
v2
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -1,23 +1,21 @@
|
||||
FROM golang:1.24.5-alpine AS builder
|
||||
|
||||
FROM golang:1.25.1-alpine AS builder
|
||||
ENV CGO_ENABLED=0
|
||||
ENV GOOS=linux
|
||||
ENV GOARCH=amd64
|
||||
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
|
||||
RUN go generate ./...
|
||||
RUN go build -ldflags="-w -s" -o /pastebin .
|
||||
|
||||
FROM gcr.io/distroless/static-debian12
|
||||
|
||||
COPY --from=builder --chown=nonroot:nonroot /pastebin /pastebin
|
||||
COPY --from=builder --chown=nonroot:nonroot /app/view/style.css /view/style.css
|
||||
|
||||
USER nonroot:nonroot
|
||||
FROM alpine:latest
|
||||
RUN apk --no-cache add ca-certificates
|
||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||
RUN mkdir /data && chown appuser:appgroup /data
|
||||
USER appuser
|
||||
COPY --from=builder /pastebin /pastebin
|
||||
COPY --from=builder /app/view/style.css /view/style.css
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT ["/pastebin"]
|
||||
VOLUME /data
|
||||
ENTRYPOINT ["/pastebin", "-db-path=/data/pastebin.db"]
|
||||
|
||||
Reference in New Issue
Block a user