From 3cea5519880cbcff93385e73671ea3d919599445 Mon Sep 17 00:00:00 2001 From: psssix Date: Wed, 20 Jul 2022 01:05:08 +0300 Subject: [PATCH] feat: debug multistage build --- .dockerignore | 5 +---- Dockerfile | 8 ++++---- config/Config.go | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.dockerignore b/.dockerignore index 7645523..6f1caf6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,7 +8,4 @@ # directories /vendor/ -/build/ - -go.mod -go.sum \ No newline at end of file +/build/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 65ad9aa..3970996 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -LABEL org.opencontainers.image.authors="psssix " - FROM golang:alpine as builder +LABEL org.opencontainers.image.authors="psssix " + # set build environmet variables needed for multistage building ENV CGO_ENABLED=0 \ GOOS=linux @@ -29,10 +29,10 @@ WORKDIR / # Copy binary from build to main folder COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder build/app app +COPY --from=builder /source/build/app app # Copy some application assets -#COPY ./database/data.json /dist/database/data.json +#COPY ./database/data.json /database/data.json # Export necessary port #EXPOSE 3000 diff --git a/config/Config.go b/config/Config.go index dffe9fa..827d757 100644 --- a/config/Config.go +++ b/config/Config.go @@ -8,7 +8,7 @@ import ( type Config struct { API struct { Token string `env:"TOKEN" env-layout:"string" env-required:"true"` - Owner int `env:"OWNER" env-layout:"int" env-required:"true"` + Owner int `env:"OWNER" env-layout:"int" env-required:"true"` } Paths struct { Docs string `env:"DOCS_PATH" env-layout:"string" env-default:"docs" env-upd:"true"` @@ -23,7 +23,7 @@ func GetConfig() Config { once.Do(func() { err := cleanenv.ReadEnv(&cfg) if err != nil { - panic(err.Error()) + panic(err) } }) return cfg