check that gomod dir available before binding
All checks were successful
Deploy / CreateImage (push) Successful in 2m14s
Deploy / DeployService (push) Successful in 25s

This commit is contained in:
skeris 2024-12-30 01:46:06 +03:00
parent 4b3ee58dd2
commit d17fe644d1
4 changed files with 4 additions and 11 deletions

1
.gitignore vendored

@ -1,3 +1,4 @@
.idea
main
.vscode
DockerTest

@ -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"]

@ -19,6 +19,7 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"time"
"os"
)
type Build struct {
@ -37,7 +38,7 @@ func Run(cfg *config.Config, build Build) {
panic(err)
}
logger.Info("RUN", zap.Any("ENV", cfg))
logger.Info("RUN", zap.Any("ENV", cfg), zap.String("JWT_SECRET", os.Getenv("JWT_SECRET")))
ctx := context.Background()

@ -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