mirror of
https://github.com/renorris/openfsd
synced 2026-03-22 06:25:35 +08:00
30 lines
611 B
Plaintext
30 lines
611 B
Plaintext
LABEL org.opencontainers.image.source=https://github.com/renorris/openfsd
|
|
|
|
FROM golang:1.24 AS build
|
|
|
|
WORKDIR /go/src/fsdweb
|
|
COPY go.mod go.sum ./
|
|
|
|
# Cache module downloads
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
# Cache builds
|
|
ENV GOCACHE=/root/.cache/go-build
|
|
RUN --mount=type=cache,target="/root/.cache/go-build" \
|
|
cd web && \
|
|
CGO_ENABLED=0 go build -o /go/bin/fsdweb
|
|
|
|
FROM alpine:latest
|
|
|
|
RUN addgroup -g 2001 nonroot && \
|
|
adduser -u 2001 -G nonroot -D nonroot && \
|
|
mkdir /db && chown -R nonroot:nonroot /db
|
|
|
|
COPY --from=build --chown=nonroot:nonroot /go/bin/fsdweb /
|
|
|
|
USER 2001:2001
|
|
|
|
CMD ["/fsdweb"]
|