From 7234dc07acf03bacf5516a8158f8993df19a6e66 Mon Sep 17 00:00:00 2001 From: Ethan Li Date: Mon, 29 Apr 2024 12:43:20 -0700 Subject: [PATCH] Fix Docker container healthcheck with Caddy reverse-proxying --- Dockerfile | 2 +- pkg/compose-frontend.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8df2861..53c320b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,4 +30,4 @@ EXPOSE 8501 HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health # Run the Streamlit app -ENTRYPOINT ["streamlit", "run", "app_model.py", "--server.port=8501", "--server.address=::", "--server.headless=true"] +ENTRYPOINT ["streamlit", "run", "app_model.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.headless=true"] diff --git a/pkg/compose-frontend.yml b/pkg/compose-frontend.yml index ddd3496..5ab9ad1 100644 --- a/pkg/compose-frontend.yml +++ b/pkg/compose-frontend.yml @@ -9,6 +9,8 @@ services: caddy.handle_path.reverse_proxy: "{{upstreams 8501}}" environment: STREAMLIT_SERVER_BASE_URL_PATH: /ps/streamlit-demo + healthcheck: + test: curl --fail http://localhost:8501/ps/streamlit-demo/_stcore/health || exit 1 networks: caddy-ingress: