monero-docs/Dockerfile_coolify
plowsof 2b8fdcc6cd Dockerfile_coolify: add Onion-Location header
Co-authored-by: nahuhh <50635951+nahuhh@users.noreply.github.com>
2024-08-30 00:47:25 +01:00

32 lines
699 B
Text

FROM python:3.9-slim AS builder
WORKDIR /monero-docs
COPY . /monero-docs
RUN pip install -r requirements.txt
RUN mkdocs build
FROM nginx:alpine
COPY --from=builder /monero-docs/public /usr/share/nginx/html
# Inline Nginx configuration
RUN echo 'server { \
listen 80; \
add_header Onion-Location http://xmrdoc6phnvjbf5hmjbwdfu47zavzfngymlnwhs2gyxxpxmad4c65kyd.onion$request_uri; \
root /usr/share/nginx/html; \
index index.html index.htm; \
error_page 404 /404.html; \
location = /404.html { \
internal; \
} \
location / { \
try_files $uri $uri/ =404; \
} \
}' > /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]