From 59fcb1fc47ef83e9eefa296939bb43da1466027f Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Mon, 9 Jul 2018 22:09:11 +0200 Subject: [PATCH] Use env templates --- Dockerfile | 3 +++ cmd/eksterd/main.go | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 21b2481..cd130ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM ubuntu RUN apt-get -y update && apt-get install -y ca-certificates +RUN ["mkdir", "/usr/share/eksterd"] ADD ./eksterd /usr/local/bin +ADD ./templates /usr/share/eksterd EXPOSE 80 +ENV EKSTER_TEMPLATES "/usr/share/eksterd" ENTRYPOINT ["/usr/local/bin/eksterd"] diff --git a/cmd/eksterd/main.go b/cmd/eksterd/main.go index 4647dfd..91e277d 100644 --- a/cmd/eksterd/main.go +++ b/cmd/eksterd/main.go @@ -114,7 +114,10 @@ func (h *mainHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } - t, err := template.ParseFiles("templates/index.html", "templates/settings.html") + t, err := template.ParseFiles( + os.Getenv("EKSTER_TEMPLATES")+"/templates/index.html", + os.Getenv("EKSTER_TEMPLATES")+"/templates/settings.html", + ) var page indexPage page.Session = sess