2018-11-04 14:58:15 +00:00
|
|
|
# Build
|
|
|
|
FROM golang:alpine as builder
|
|
|
|
|
|
|
|
RUN apk add --no-cache git ca-certificates && \
|
2018-11-04 15:39:38 +00:00
|
|
|
mkdir -p $GOPATH/src/git.adphi.net/Adphi/ytsflix && \
|
2018-11-04 14:58:15 +00:00
|
|
|
mkdir /build
|
|
|
|
|
2018-11-04 15:39:38 +00:00
|
|
|
WORKDIR $GOPATH/src/git.adphi.net/Adphi/ytsflix
|
2018-11-04 14:58:15 +00:00
|
|
|
ADD . .
|
|
|
|
|
|
|
|
RUN go get -u github.com/gobuffalo/packr/... && \
|
|
|
|
packr && \
|
|
|
|
CGO_ENABLED=0 go build -v -o /build/ytsflix cmd/main.go
|
|
|
|
|
|
|
|
# Create Container's Image
|
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
# Copy certs from alpine to avoid "x509: certificate signed by unknown authority"
|
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
COPY --from=builder /build/* /bin/
|
|
|
|
|
|
|
|
ENV LOG_LEVEL=INFO
|
|
|
|
ENV DATA_DIR=/downloads
|
2018-11-04 15:39:38 +00:00
|
|
|
|
|
|
|
VOLUME /download
|
|
|
|
|
2018-11-04 14:58:15 +00:00
|
|
|
EXPOSE 8080
|
|
|
|
|
|
|
|
CMD ["ytsflix"]
|