diff --git a/Dockerfile b/Dockerfile index 498bc31..3058803 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,22 @@ FROM golang:alpine # Set necessary environmet variables needed for our image -ENV GO111MODULE=on \ +ENV GO111MODULE=auto \ CGO_ENABLED=0 \ GOOS=linux \ GOARCH=amd64 +WORKDIR /app + +COPY go.mod . +COPY go.sum . + +RUN go mod download + # Copy the code into the container COPY . . # Build the application -RUN go build -o main . - -# Move to /dist directory as the place for resulting binary folder -WORKDIR /dist - -# Copy binary from build to main folder -RUN cp /build/main . +RUN go build -# Command to run when starting the container -CMD ["/dist/main"] \ No newline at end of file +ENTRYPOINT ["/app/main"] \ No newline at end of file