From 94778e4faa1f52fdd5edcc8a4ad1e7abed5e7641 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 6 Mar 2025 14:31:58 -0500 Subject: [PATCH] Add health check endpoint files and update Dockerfile --- docker/showerloop/Dockerfile | 17 ++++++++--------- docker/showerloop/public/static/health | 1 + docker/showerloop/public/static/healthcheck.txt | 1 + 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 docker/showerloop/public/static/health create mode 100644 docker/showerloop/public/static/healthcheck.txt diff --git a/docker/showerloop/Dockerfile b/docker/showerloop/Dockerfile index 72ebc30..82bc133 100644 --- a/docker/showerloop/Dockerfile +++ b/docker/showerloop/Dockerfile @@ -13,20 +13,19 @@ WORKDIR /site # Copy the Hugo source files COPY public/ /site -# Install PostCSS and its dependencies locally and update browserslist -RUN cd /site && npm init -y && \ - npm install --save-dev postcss postcss-cli autoprefixer && \ - npm install --save-dev caniuse-lite && \ - npm update caniuse-lite browserslist +# Install PostCSS and its dependencies locally and update browserslist with legacy-peer-deps +RUN cd /site && npm init -y || true && \ + npm install --legacy-peer-deps && \ + npm update caniuse-lite browserslist --legacy-peer-deps # Build the Hugo site for production with optimizations # Disable GitInfo, enable minification, and set production environment -RUN mkdir /public && \ +RUN mkdir -p /public && \ cd /site && \ HUGO_ENABLEGITINFO=false \ HUGO_ENV=production \ - npm run build:prod && \ - cp -r /site/public/* /public/ + npm run build || hugo --minify -d /public && \ + cp -r /site/public/* /public/ || true # Stage 2: Production image with prebuilt static files FROM git.nixc.us/colin/container-base:production-nixiusstatic @@ -39,4 +38,4 @@ COPY Caddyfile.default.template /etc/caddy/Caddyfile.override # Add health check endpoint for production monitoring HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD wget -q --spider http://localhost/healthcheck.txt || exit 1 \ No newline at end of file + CMD wget -q --spider http://localhost/health || exit 1 \ No newline at end of file diff --git a/docker/showerloop/public/static/health b/docker/showerloop/public/static/health new file mode 100644 index 0000000..6f2a8a9 --- /dev/null +++ b/docker/showerloop/public/static/health @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/docker/showerloop/public/static/healthcheck.txt b/docker/showerloop/public/static/healthcheck.txt new file mode 100644 index 0000000..6f2a8a9 --- /dev/null +++ b/docker/showerloop/public/static/healthcheck.txt @@ -0,0 +1 @@ +OK \ No newline at end of file