YTSFlix_Go/Dockerfile

35 lines
622 B
Docker
Raw Normal View History

2018-11-04 14:58:15 +00:00
# Build
FROM golang:alpine as builder
RUN apk add --no-cache git ca-certificates && \
mkdir /build
WORKDIR /ytsflix
COPY go.mod .
2018-11-04 14:58:15 +00:00
RUN go get -u github.com/gobuffalo/packr/... && \
packr
RUN go mod download
ADD . .
RUN CGO_ENABLED=0 packr build -v -o /build/ytsflix cmd/ytsflix/main.go
2018-11-04 14:58:15 +00:00
# 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"]