File tree Expand file tree Collapse file tree 3 files changed +67
-0
lines changed
Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ worker_processes auto;
2+ pid /tmp/nginx.pid ;
3+ error_log /dev/stderr;
4+
5+ events {
6+ worker_connections 1024 ;
7+ }
8+
9+ http {
10+ include /etc/nginx/mime.types ;
11+ default_type application/octet-stream ;
12+
13+ access_log /dev/stdout;
14+
15+ sendfile on;
16+ keepalive_timeout 65 ;
17+
18+ client_body_temp_path /tmp/nginx_client_body;
19+ proxy_temp_path /tmp/nginx_proxy;
20+ fastcgi_temp_path /tmp/nginx_fastcgi;
21+ uwsgi_temp_path /tmp/nginx_uwsgi;
22+ scgi_temp_path /tmp/nginx_scgi;
23+
24+ server {
25+ listen unix:/var/run/cabotage/cabotage.sock;
26+ server_name _;
27+
28+ location / {
29+ root /usr/share/nginx/html;
30+ index index .html;
31+ }
32+
33+ error_page 500 502 503 504 /50x .html;
34+ location = /50x .html {
35+ root /usr/share/nginx/html;
36+ }
37+ }
38+ }
Original file line number Diff line number Diff line change 1+ # Stage 1: Build the docs (mirrors .readthedocs.yml)
2+ FROM python:3 AS builder
3+
4+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
5+
6+ WORKDIR /docs
7+
8+ # Install deps first (cached layer + mount cache for uv)
9+ COPY requirements.txt Makefile ./
10+ RUN --mount=type=cache,target=/root/.cache/uv \
11+ make ensure-venv
12+
13+ COPY . .
14+
15+ # Build dirhtml, same as RTD: make dirhtml BUILDDIR=_readthedocs
16+ RUN make dirhtml BUILDDIR=_readthedocs
17+
18+ # Stage 2: Serve via nginx
19+ FROM nginx:alpine
20+
21+ COPY .cabotage/nginx.conf /etc/nginx/nginx.conf
22+ RUN rm /etc/nginx/conf.d/default.conf && \
23+ mkdir -p /var/run/cabotage && \
24+ chown nobody:nobody /var/run/cabotage
25+
26+ COPY --from=builder /docs/_readthedocs/dirhtml /usr/share/nginx/html
27+
28+ USER nobody
Original file line number Diff line number Diff line change 1+ web: nginx -g 'daemon off;'
You can’t perform that action at this time.
0 commit comments