Added sphinx docker role draft

This commit is contained in:
2025-03-15 21:31:10 +01:00
parent c1aa6823b0
commit 2095f16402
20 changed files with 187 additions and 13 deletions

View File

@@ -0,0 +1,22 @@
FROM python:{{applications[application_id].version}}
# Install required packages including 'make'
RUN apt-get update && apt-get install -y make
# Set the working directory
WORKDIR {{docker_app_dir}}
# Copy the project files into the container
COPY {{host_cymais_volume_dir_relative}} {{docker_app_dir}}
# Install Python packages via requirements.txt
RUN cd {{docker_sphinx_dir}} && pip install --upgrade pip && pip install -r requirements.txt
# Build the HTML documentation using Sphinx with the defined directories
RUN cd {{docker_sphinx_dir}} && make html
# Expose port 8000 where the HTTP server will run
EXPOSE 8000
# Start a simple HTTP server to serve the built documentation
CMD ["python", "-m", "http.server", "8000", "--directory", "${BUILD_DIR}"]

View File

@@ -0,0 +1,13 @@
services:
application:
build: .
ports:
- "127.0.0.1:{{ports.localhost.http[application_id]}}:8000"
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8000"]
interval: 1m
timeout: 10s
retries: 3
{% include 'templates/docker/container/networks.yml.j2' %}
{% include 'templates/docker/compose/networks.yml.j2' %}

View File

@@ -0,0 +1,2 @@
SOURCE_DIR={{docker_source_dir}}
BUILD_DIR={{docker_output_dir}}