use go mod in Dockerfile

This commit is contained in:
Tobias Lindberg
2021-02-18 13:06:58 +01:00
parent bf0f549f82
commit 233e6f4a16
+5 -2
View File
@@ -4,8 +4,11 @@ FROM golang:1.15.8
# create and set workingfolder
WORKDIR /go/src/
# download dependencies
RUN go get -v -u -d github.com/gin-gonic/gin github.com/lib/pq github.com/eclipse/paho.mqtt.golang github.com/go-sql-driver/mysql
# copy go mod files
COPY go.mod go.sum ./
# download go mods
RUN go mod download
# copy all sourcecode
COPY src/ .