check that gomod dir available before binding
This commit is contained in:
parent
4b3ee58dd2
commit
9c47e657e1
@ -2,17 +2,13 @@ FROM gitea.pena/penadevops/container-images/golang:main as build
|
||||
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 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
|
||||
COPY . .
|
||||
RUN --mount=type=bind,source=go-cache,dst=/go/pkg/mod/,rw=true go mod download
|
||||
RUN go mod download
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app ./cmd/verification/main.go
|
||||
RUN ls /go/pkg/mod/
|
||||
RUN pwd
|
||||
RUN printenv
|
||||
|
||||
FROM gitea.pena/penadevops/container-images/alpine:main
|
||||
COPY --from=build app/app .
|
||||
COPY --from=build app/staging.env .
|
||||
COPY --from=build app/assets ./assets
|
||||
RUN apk add --no-cache ca-certificates
|
||||
CMD ["/app"]
|
||||
|
@ -3,7 +3,6 @@ package config
|
||||
import (
|
||||
"gitea.pena/PenaSide/common/mongo"
|
||||
"github.com/caarlos0/env/v8"
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@ -28,10 +27,6 @@ type External struct {
|
||||
}
|
||||
|
||||
func NewConfig(file ...string) (*Config, error) {
|
||||
if err := godotenv.Load(file...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var cfg Config
|
||||
if err := env.Parse(&cfg); err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user