Archived
2
0

add HEALTHCHECK.

This commit is contained in:
m1k1o 2021-03-19 14:42:54 +01:00
parent 14939db65a
commit ed2cdaf71d
3 changed files with 8 additions and 0 deletions

View File

@ -117,6 +117,9 @@ ENV NEKO_BIND=:8080
COPY --from=server /src/bin/neko /usr/bin/neko COPY --from=server /src/bin/neko /usr/bin/neko
COPY --from=client /src/dist/ /var/www COPY --from=client /src/dist/ /var/www
HEALTHCHECK --interval=10s --timeout=5s --retries=8 \
CMD wget -O - http://localhost:${NEKO_BIND#*:}/health || exit 1
# #
# run neko # run neko
CMD ["/usr/bin/supervisord", "-c", "/etc/neko/supervisord.conf"] CMD ["/usr/bin/supervisord", "-c", "/etc/neko/supervisord.conf"]

View File

@ -55,6 +55,7 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms.
- Fixed small lags in video and improved video UX (by @mbattista). - Fixed small lags in video and improved video UX (by @mbattista).
- Added `m1k1o/neko:vncviewer` tag, use `NEKO_VNC_URL` to specify VNC target and use n.eko as a bridge. - Added `m1k1o/neko:vncviewer` tag, use `NEKO_VNC_URL` to specify VNC target and use n.eko as a bridge.
- Abiltiy to include neko as a component in another Vue.Js project (by @gbrian). - Abiltiy to include neko as a component in another Vue.Js project (by @gbrian).
- Added HEALTHCHECK to Dockerfile.
# Getting started & FAQ # Getting started & FAQ

View File

@ -34,6 +34,10 @@ func New(conf *config.Server, webSocketHandler types.WebSocketHandler) *Server {
webSocketHandler.Upgrade(w, r) webSocketHandler.Upgrade(w, r)
}) })
router.Get("/health", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("true"))
})
fs := http.FileServer(http.Dir(conf.Static)) fs := http.FileServer(http.Dir(conf.Static))
router.Get("/*", func(w http.ResponseWriter, r *http.Request) { router.Get("/*", func(w http.ResponseWriter, r *http.Request) {
if _, err := os.Stat(conf.Static + r.URL.Path); !os.IsNotExist(err) { if _, err := os.Stat(conf.Static + r.URL.Path); !os.IsNotExist(err) {