From 94e699549d0d6aab25c52c2f44777f58b7e626b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=93=D0=BB=D0=B0=D0=B7=D1=83?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Fri, 5 Dec 2025 13:21:33 +0300 Subject: [PATCH] Add initial Docker configuration and documentation setup --- .dockerignore | 16 ++++++++++++++++ Dockerfile | 7 +++++++ config.docs.yaml | 31 +++++++++++++++++++++++++++++++ docker-compose.yml | 15 +++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 config.docs.yaml create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a88319c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,16 @@ +__pycache__ +*.pyc +*.pyo +*.pyd +.Python +*.so +*.egg +*.egg-info +dist +build +.git +.gitignore +.dockerignore +Dockerfile +docker-compose.yml +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e5d1a72 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.13-slim +WORKDIR /app +RUN pip install --no-cache-dir https://git.pyserve.org/Shifty/pyserveX/releases/download/v0.9.10/pyserve-0.9.10-py3-none-any.whl +COPY . /app/docs/ +COPY config.docs.yaml /app/config.docs.yaml +EXPOSE 80 +CMD ["pyserve", "-c", "/app/config.docs.yaml"] diff --git a/config.docs.yaml b/config.docs.yaml new file mode 100644 index 0000000..b1f0cf9 --- /dev/null +++ b/config.docs.yaml @@ -0,0 +1,31 @@ +# PyServe configuration for serving documentation +# Usage: pyserve -c config.docs.yaml + +http: + static_dir: . + +server: + host: 0.0.0.0 + port: 80 + backlog: 1000 + default_root: false + +ssl: + enabled: false + +logging: + level: INFO + console_output: true + +extensions: + - type: routing + config: + regex_locations: + "~*\\.(css)$": + root: "./docs" + cache_control: "public, max-age=3600" + + "__default__": + root: "./docs" + index_file: "index.html" + cache_control: "no-cache" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7a3e245 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3.8' + +services: + pyserve-docs: + build: + context: . + dockerfile: Dockerfile + container_name: pyserve-docs + networks: + - pyserve_pyserve-network + restart: unless-stopped + +networks: + pyserve_pyserve-network: + external: true