diff --git a/Dockerfile b/Dockerfile index e401cfc..4d7e33f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,17 @@ -FROM golang:1.15.5-alpine as build_go +FROM golang:1.16-alpine as build_go -COPY *.go go.mod /music-server/ -WORKDIR /music-server -RUN go build +COPY go.* /music-server/ +COPY ./cmd /music-server/cmd/ +COPY ./pkg /music-server/pkg/ + +WORKDIR /music-server/ +RUN go mod download + +WORKDIR /music-server/cmd/backend +RUN go build -o /music-server/MusicServer # Stage 2, distribution container -FROM golang:1.15.5-alpine +FROM golang:1.16-alpine RUN apk add --no-cache bash EXPOSE 8080 VOLUME /sorted diff --git a/go.mod b/go.mod index ca33012..476622e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module music-server -go 1.15 +go 1.16 require ( github.com/gorilla/mux v1.8.0