You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
600 B
25 lines
600 B
FROM golang:1.24-alpine AS build
|
|
|
|
WORKDIR /src
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . ./
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/webfilebrowser ./cmd/webfilebrowser
|
|
|
|
FROM alpine:3.21
|
|
|
|
RUN addgroup -S webfilebrowser && adduser -S -G webfilebrowser webfilebrowser \
|
|
&& mkdir -p /var/lib/webfilebrowser \
|
|
&& chown webfilebrowser:webfilebrowser /var/lib/webfilebrowser
|
|
|
|
COPY --from=build /out/webfilebrowser /usr/local/bin/webfilebrowser
|
|
|
|
USER webfilebrowser
|
|
|
|
EXPOSE 8080
|
|
|
|
ENV WEB_FILE_BROWSER_ADDR=:8080
|
|
|
|
ENTRYPOINT ["/usr/local/bin/webfilebrowser"]
|
|
|