diff --git a/Dockerfile.target b/Dockerfile.target index 302dedf..50338c1 100644 --- a/Dockerfile.target +++ b/Dockerfile.target @@ -25,5 +25,5 @@ RUN chmod 755 /entrypoint.sh EXPOSE 80 -CMD ["/app"] +CMD ["sh", "-c", "/app"] ENTRYPOINT ["/entrypoint.sh"] diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh index f5ab326..e872887 100755 --- a/bin/entrypoint.sh +++ b/bin/entrypoint.sh @@ -20,6 +20,6 @@ waitForService "api-registry:8500" # waitForService "api-eventbus:5672" -set -euo pipefail +# set -euo pipefail exec "$@" diff --git a/src/go.mod b/src/go.mod index 2533f87..51b156b 100644 --- a/src/go.mod +++ b/src/go.mod @@ -3,7 +3,7 @@ module git.pbiernat.dev/egommerce/identity-service go 1.18 require ( - git.pbiernat.dev/egommerce/go-api-pkg v0.0.111 + git.pbiernat.dev/egommerce/go-api-pkg v0.0.113 github.com/gofiber/fiber/v2 v2.40.1 github.com/gofiber/jwt/v2 v2.2.7 github.com/golang-jwt/jwt v3.2.2+incompatible diff --git a/src/go.sum b/src/go.sum index 3272563..4986b4d 100644 --- a/src/go.sum +++ b/src/go.sum @@ -16,6 +16,10 @@ git.pbiernat.dev/egommerce/go-api-pkg v0.0.110 h1:GLFO4LPYSw1nNBizssgo+alsaGhf33 git.pbiernat.dev/egommerce/go-api-pkg v0.0.110/go.mod h1:nAwcw2MZtn/54YKq8VQK6RJAsiuoLUtPuazXg8JcqK8= git.pbiernat.dev/egommerce/go-api-pkg v0.0.111 h1:+OjaodnVXQC1w3nlK3VBy1HswxbduvHVga5UyH52yK4= git.pbiernat.dev/egommerce/go-api-pkg v0.0.111/go.mod h1:nAwcw2MZtn/54YKq8VQK6RJAsiuoLUtPuazXg8JcqK8= +git.pbiernat.dev/egommerce/go-api-pkg v0.0.112 h1:opyN5gb1tOfbLDFilJbHuPaVClLqBe/FPLO6qYJFy/s= +git.pbiernat.dev/egommerce/go-api-pkg v0.0.112/go.mod h1:nAwcw2MZtn/54YKq8VQK6RJAsiuoLUtPuazXg8JcqK8= +git.pbiernat.dev/egommerce/go-api-pkg v0.0.113 h1:kf7HesezhXIAMNYgLCm8x6YVqyLqJRqaPKIFEXf4xSs= +git.pbiernat.dev/egommerce/go-api-pkg v0.0.113/go.mod h1:nAwcw2MZtn/54YKq8VQK6RJAsiuoLUtPuazXg8JcqK8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= diff --git a/src/internal/app/server/server.go b/src/internal/app/server/server.go index 418dcb8..ed040b8 100644 --- a/src/internal/app/server/server.go +++ b/src/internal/app/server/server.go @@ -3,6 +3,7 @@ package server import ( "bytes" "encoding/json" + "errors" "fmt" "os" "os/signal" @@ -49,6 +50,7 @@ func NewServer(conf *Config, logger *fluentd.Logger, db *pgxpool.Pool /*, ebCh * ReadTimeout: time.Millisecond * 50, WriteTimeout: time.Millisecond * 50, IdleTimeout: time.Millisecond * 50, + // Prefork: true, } s := &Server{ fiber.New(cnf), @@ -122,6 +124,10 @@ func (s *Server) updateKVConfig() error { return err } + if config == nil { + return errors.New("empty KV config data") + } + buf := bytes.NewBuffer(config.Value) decoder := json.NewDecoder(buf) if err := decoder.Decode(&s.conf); err != nil {