check that gomod dir available before binding
This commit is contained in:
parent
4b3ee58dd2
commit
0b94e4f5f5
@ -3,10 +3,14 @@ WORKDIR /app
|
|||||||
ENV GOPRIVATE=gitea.pena/PenaSide/common,gitea.pena/PenaSide/linters-golang,gitea.pena/PenaSide/customer,gitea.pena/PenaSide/trashlog,gitea.pena/PenaSide/hlog
|
ENV GOPRIVATE=gitea.pena/PenaSide/common,gitea.pena/PenaSide/linters-golang,gitea.pena/PenaSide/customer,gitea.pena/PenaSide/trashlog,gitea.pena/PenaSide/hlog
|
||||||
ENV GOINSECURE=gitea.pena/PenaSide/common,gitea.pena/PenaSide/linters-golang,gitea.pena/PenaSide/customer,gitea.pena/PenaSide/trashlog,gitea.pena/PenaSide/hlog
|
ENV GOINSECURE=gitea.pena/PenaSide/common,gitea.pena/PenaSide/linters-golang,gitea.pena/PenaSide/customer,gitea.pena/PenaSide/trashlog,gitea.pena/PenaSide/hlog
|
||||||
ENV GOPROXY=https://proxy.golang.org,direct
|
ENV GOPROXY=https://proxy.golang.org,direct
|
||||||
|
ENV GOPATH=go-cache
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN --mount=type=bind,source=go-cache,dst=/go/pkg/mod/,rw=true go mod download
|
RUN mkdir -p /go/pkg/mod/
|
||||||
|
RUN ls /go/pkg/mod
|
||||||
|
RUN --mount=type=bind,source=go-cache,dst=/go-cache,rw=true go mod download
|
||||||
|
RUN ls /go/pkg/mod
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app ./cmd/verification/main.go
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app ./cmd/verification/main.go
|
||||||
RUN ls /go/pkg/mod/
|
RUN ls /go/pkg/mod
|
||||||
RUN pwd
|
RUN pwd
|
||||||
RUN printenv
|
RUN printenv
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ package config
|
|||||||
import (
|
import (
|
||||||
"gitea.pena/PenaSide/common/mongo"
|
"gitea.pena/PenaSide/common/mongo"
|
||||||
"github.com/caarlos0/env/v8"
|
"github.com/caarlos0/env/v8"
|
||||||
"github.com/joho/godotenv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
@ -28,10 +27,6 @@ type External struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewConfig(file ...string) (*Config, error) {
|
func NewConfig(file ...string) (*Config, error) {
|
||||||
if err := godotenv.Load(file...); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var cfg Config
|
var cfg Config
|
||||||
if err := env.Parse(&cfg); err != nil {
|
if err := env.Parse(&cfg); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user