From 0a9b06915251c5e890b8954a757d6ce514b28563 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 5 Jul 2019 06:54:48 -0700 Subject: [PATCH] update dockerfile --- Dockerfile | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7bade1..098f63a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,13 @@ -# First build step -FROM golang:1.10-alpine as builder +FROM golang:1.12-alpine as builder +RUN apk add --no-cache git make +RUN go get -v github.com/jteeuwen/go-bindata/go-bindata +WORKDIR /go/cowyo +COPY . . +RUN make build -#WORKDIR /go/src/github.com/schollz/cowyo -#COPY . . -# Disable crosscompiling -ENV CGO_ENABLED=0 - -# Install git and make, compile and cleanup -RUN apk add --no-cache git make \ - && go get -u -v github.com/jteeuwen/go-bindata/... \ - && go get -u -v -d github.com/schollz/cowyo \ - && cd /go/src/github.com/schollz/cowyo \ - && make \ - && apk del --purge git make \ - && rm -rf /var/cache/apk* - -# Second build step uses the minimal scratch Docker image -FROM scratch -# Copy the binary from the first step -COPY --from=builder /go/src/github.com/schollz/cowyo/cowyo /usr/local/bin/cowyo -# Expose data folder +FROM alpine:latest VOLUME /data -EXPOSE 8050 -# Start cowyo listening on any host -CMD ["cowyo", "--host", "0.0.0.0"] \ No newline at end of file +EXPOSE 8152 +COPY --from=builder /go/cowyo/cowyo /cowyo +ENTRYPOINT ["/cowyo"] +CMD ["--data","/data"]