From 1746cfe2e3fde485610291849b9e47779907e2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cnishant-sharma=E2=80=9D?= Date: Wed, 31 Mar 2021 10:54:39 +0530 Subject: [PATCH] updating Dockerfile --- Dockerfile | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8f702e3..e99ec0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,28 @@ FROM golang:1.16 -RUN mkdir $GOPATH/app -WORKDIR $GOPATH/app +RUN mkdir -p /app/janus +WORKDIR /app/janus + + +COPY go.mod . +COPY go.sum . +RUN go mod download + COPY . . - -RUN go version -RUN go env - -# Download all the dependencies -RUN go get -d -v ./... - -# Install the package -RUN go install -v ./... +RUN go build -o ./out/janus . EXPOSE 8000 -CMD ["go", "run", "main.go"] +CMD ["./out/janus"] + +# COPY . . +# +# # Download all the dependencies +# RUN go get -d -v ./... +# +# # Install the package +# RUN go install -v ./... +# +# EXPOSE 8000 +# +# CMD ["go", "run", "main.go"]