🐳 Add Dockerfile

This commit is contained in:
2020-10-18 15:50:49 +02:00
parent 5a8750e637
commit 43ddb362a9
2 changed files with 24 additions and 2 deletions

22
Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
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
COPY --from=builder /src/ShareDAV /app/ShareDAV
COPY --from=builder /data /data
ENTRYPOINT ["/app/ShareDAV"]
CMD ["serve"]