2020-10-18 15:50:49 +02:00
|
|
|
FROM golang:1.15 AS builder
|
|
|
|
|
|
|
|
RUN mkdir /data && mkdir /data/shares
|
|
|
|
|
|
|
|
ADD . /src
|
|
|
|
WORKDIR /src
|
|
|
|
|
|
|
|
ENV CGO_ENABLED=0
|
|
|
|
|
|
|
|
RUN go build .
|
|
|
|
|
|
|
|
# Actual image
|
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
ENV DATA_DIR=/data/shares
|
|
|
|
ENV DATABASE=/data/ShareDAV.db
|
|
|
|
|
2020-11-01 13:16:51 +01:00
|
|
|
WORKDIR /app
|
|
|
|
|
2020-10-18 15:50:49 +02:00
|
|
|
COPY --from=builder /src/ShareDAV /app/ShareDAV
|
2020-11-01 13:16:51 +01:00
|
|
|
COPY --from=builder /src/templates /app/templates
|
2020-10-18 15:50:49 +02:00
|
|
|
COPY --from=builder /data /data
|
|
|
|
|
2020-10-18 15:57:39 +02:00
|
|
|
USER 1000:1000
|
|
|
|
|
2020-10-18 15:50:49 +02:00
|
|
|
ENTRYPOINT ["/app/ShareDAV"]
|
|
|
|
CMD ["serve"]
|