From e5b366462cf9d19ca16f5fdef532f79ca877a1ca Mon Sep 17 00:00:00 2001 From: Shaz hemani Date: Tue, 15 Sep 2020 16:15:26 +0500 Subject: [PATCH] relative paths --- Dockerfile | 4 ++-- internal/app/db.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e3bbf5..33696ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM golang:alpine as builder RUN mkdir -p /go/src/app -WORKDIR /go/src/app/cmd +WORKDIR /go/src/app ADD . /go/src/app @@ -9,4 +9,4 @@ ADD . /go/src/app #Run go build -o bins/genityapp -CMD ["/go/src/app/bins/./genityapp"] \ No newline at end of file +CMD ["./bins/genityapp"] \ No newline at end of file diff --git a/internal/app/db.go b/internal/app/db.go index 13472f9..1660da6 100644 --- a/internal/app/db.go +++ b/internal/app/db.go @@ -45,7 +45,8 @@ func CloseDB() { func goDotEnvVariable(key string) string { // load .env file - err := godotenv.Load("/go/src/app/configs/web.env") + pwd, _ := os.Getwd() + err := godotenv.Load(pwd + "/configs/web.env") if err != nil { log.Fatalf(err.Error())