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