diff options
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e7aeed9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM golang:1.25-alpine AS builder + +WORKDIR /src + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ + go build -trimpath -ldflags="-s -w" -o /out/gallery . + +FROM alpine:3.22 + +RUN addgroup -S -g 1000 app && adduser -S -D -u 1000 -G app app + +WORKDIR /app +COPY --from=builder --chown=app:app /out/gallery /app/gallery +RUN mkdir /app/data && chown app:app /app/data + +VOLUME /app/data +EXPOSE 8020 +ENV HOME=/app +USER app +ENTRYPOINT ["/app/gallery"] +CMD ["serve", "--addr", ":8020", "--data", "/app/data"] |
