forked from filebrowser/filebrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (30 loc) · 873 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM golang:latest as builder
RUN apt-get update && apt-get install -y nocache git ca-certificates && update-ca-certificates
ENV USER=klovercloud
ENV UID=1000
RUN adduser \
--disabled-password \
--uid "${UID}" \
"${USER}"
WORKDIR /app
COPY go.mod go.sum ./
#RUN go env -w GOPROXY="https://goproxy.io,direct"
RUN go mod download
COPY . .
RUN go install github.com/GeertJohan/go.rice/rice
WORKDIR /app/http
RUN rm -rf rice-box.go
RUN rice embed-go
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/bin/filebrowser .
FROM debian:buster
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
VOLUME /db
VOLUME /srv-fb
COPY .docker.json /app/.filebrowser.json
COPY --from=builder /app/bin /app
EXPOSE 8000
CMD ["./filebrowser"]