Use env templates

This commit is contained in:
Peter Stuifzand 2018-07-09 22:09:11 +02:00
parent bcdb16bc6e
commit 59fcb1fc47
2 changed files with 7 additions and 1 deletions

View File

@ -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"]

View File

@ -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