From a6acc63a0c743aaa528f98e49179edc0993f624a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=9Cmit=20=C3=96zden?= Date: Mon, 6 Nov 2023 00:13:23 +0300 Subject: [PATCH] fix: Add configs properly to final image * build: Add configs folder to store configs of adapters * refactor: Add redirection config to configs folder --- Dockerfile | 2 ++ cmd/main.go | 2 +- configs/redirection.yaml | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 configs/redirection.yaml diff --git a/Dockerfile b/Dockerfile index 1ac2a6a..8f36a1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,4 +23,6 @@ FROM scratch as final COPY --from=builder /app/dexus . +COPY --from=builder /app/configs /configs + ENTRYPOINT [ "./dexus" ] diff --git a/cmd/main.go b/cmd/main.go index 8f0d123..8524bf5 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -25,7 +25,7 @@ func main() { logger := stdlog.NewStdLog(debugLevel) logger.Info(fmt.Sprintf("Version: %s | Commit: %s", Version, Commit)) cacher := memcache.NewMemCache(logger) - fPath := filepath.FromSlash("test_data/redirection.yaml") + fPath := filepath.FromSlash("configs/redirection.yaml") redirectRepo, err := fileredirect.NewYamlRedirect(logger, fPath) if err != nil { os.Exit(1) diff --git a/configs/redirection.yaml b/configs/redirection.yaml new file mode 100644 index 0000000..1ab9ff6 --- /dev/null +++ b/configs/redirection.yaml @@ -0,0 +1,3 @@ +redirections: + /abc : https://google.com + /xyz : https://github.com