From 357642575955b3d909d37dbcddc491a773da222e Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Tue, 10 Mar 2026 17:08:00 -0400 Subject: [PATCH 1/5] dockerize for cabotage --- .cabotage/nginx.conf | 38 ++++++++++++++++++++++++++++++++++++++ Dockerfile.cabotage | 28 ++++++++++++++++++++++++++++ Procfile.cabotage | 1 + 3 files changed, 67 insertions(+) create mode 100644 .cabotage/nginx.conf create mode 100644 Dockerfile.cabotage create mode 100644 Procfile.cabotage diff --git a/.cabotage/nginx.conf b/.cabotage/nginx.conf new file mode 100644 index 000000000..79611903c --- /dev/null +++ b/.cabotage/nginx.conf @@ -0,0 +1,38 @@ +worker_processes auto; +pid /tmp/nginx.pid; +error_log /dev/stderr; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + access_log /dev/stdout; + + sendfile on; + keepalive_timeout 65; + + client_body_temp_path /tmp/nginx_client_body; + proxy_temp_path /tmp/nginx_proxy; + fastcgi_temp_path /tmp/nginx_fastcgi; + uwsgi_temp_path /tmp/nginx_uwsgi; + scgi_temp_path /tmp/nginx_scgi; + + server { + listen unix:/var/run/cabotage/cabotage.sock; + server_name _; + + location / { + root /usr/share/nginx/html; + index index.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } +} diff --git a/Dockerfile.cabotage b/Dockerfile.cabotage new file mode 100644 index 000000000..12d8db3c3 --- /dev/null +++ b/Dockerfile.cabotage @@ -0,0 +1,28 @@ +# Stage 1: Build the docs (mirrors .readthedocs.yml) +FROM python:3 AS builder + +COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv + +WORKDIR /docs + +# Install deps first (cached layer + mount cache for uv) +COPY requirements.txt Makefile ./ +RUN --mount=type=cache,target=/root/.cache/uv \ + make ensure-venv + +COPY . . + +# Build dirhtml, same as RTD: make dirhtml BUILDDIR=_readthedocs +RUN make dirhtml BUILDDIR=_readthedocs + +# Stage 2: Serve via nginx +FROM nginx:alpine + +COPY .cabotage/nginx.conf /etc/nginx/nginx.conf +RUN rm /etc/nginx/conf.d/default.conf && \ + mkdir -p /var/run/cabotage && \ + chown nobody:nobody /var/run/cabotage + +COPY --from=builder /docs/_readthedocs/dirhtml /usr/share/nginx/html + +USER nobody diff --git a/Procfile.cabotage b/Procfile.cabotage new file mode 100644 index 000000000..4a821aab9 --- /dev/null +++ b/Procfile.cabotage @@ -0,0 +1 @@ +web: nginx -g 'daemon off;' From 8f0b39fbf03b13be6607256cbc7700fe84ba0ad0 Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Tue, 10 Mar 2026 17:13:54 -0400 Subject: [PATCH 2/5] add health check --- .cabotage/nginx.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.cabotage/nginx.conf b/.cabotage/nginx.conf index 79611903c..9f5dbb603 100644 --- a/.cabotage/nginx.conf +++ b/.cabotage/nginx.conf @@ -25,6 +25,11 @@ http { listen unix:/var/run/cabotage/cabotage.sock; server_name _; + location = /_health/ { + access_log off; + return 200 "OK"; + } + location / { root /usr/share/nginx/html; index index.html; From 1967aab4c5e85c30575145d4bf46f17fcd87674f Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Tue, 10 Mar 2026 17:14:55 -0400 Subject: [PATCH 3/5] deploy From aae5d83b921f3fd41e07d8c89f767ed11fff27a6 Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Tue, 10 Mar 2026 17:16:36 -0400 Subject: [PATCH 4/5] d'oh --- .cabotage/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cabotage/nginx.conf b/.cabotage/nginx.conf index 9f5dbb603..2698d6701 100644 --- a/.cabotage/nginx.conf +++ b/.cabotage/nginx.conf @@ -25,7 +25,7 @@ http { listen unix:/var/run/cabotage/cabotage.sock; server_name _; - location = /_health/ { + location /_health/ { access_log off; return 200 "OK"; } From 230b283aa2e43e03fbda9f31117b1f1ec87fe41e Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Tue, 10 Mar 2026 17:18:09 -0400 Subject: [PATCH 5/5] demote myself --- developer-workflow/development-cycle.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer-workflow/development-cycle.rst b/developer-workflow/development-cycle.rst index af198a400..42bd9ea83 100644 --- a/developer-workflow/development-cycle.rst +++ b/developer-workflow/development-cycle.rst @@ -296,7 +296,7 @@ Current owners +----------------------+--------------------------------+-----------------+ | Donald Stufft | Infrastructure Staff | dstufft | +----------------------+--------------------------------+-----------------+ -| Ee Durbin | Infrastructure Staff | ewdurbin | +| Ee Durbin | Infrastructure Volunteer | ewdurbin | +----------------------+--------------------------------+-----------------+ | Jacob Coffee | PSF Infrastructure Engineer | JacobCoffee | +----------------------+--------------------------------+-----------------+