Solved Sphinx Role bugs

This commit is contained in:
2025-03-16 18:09:37 +01:00
parent 985ed797bd
commit 3e1a9e9dde
4 changed files with 15 additions and 17 deletions

View File

@@ -1,35 +0,0 @@
FROM python:{{applications[application_id].version}}
ARG SPHINX_SOURCE_DIR
ARG SPHINX_BUILD_DIR
ARG SPHINX_EXEC_DIR
ARG SPHINX_APP_DIR
ARG SPHINX_SOURCE_DIR_RELATIVE
# Set the environment variables so they are available during build
ENV SPHINX_SOURCE_DIR=${SPHINX_SOURCE_DIR}
ENV SPHINX_SOURCE_DIR_RELATIVE=${SPHINX_SOURCE_DIR_RELATIVE}
ENV SPHINX_BUILD_DIR=${SPHINX_BUILD_DIR}
ENV SPHINX_EXEC_DIR=${SPHINX_EXEC_DIR}
ENV SPHINX_APP_DIR=${SPHINX_APP_DIR}
# Install required packages
RUN apt-get update && apt-get install -y make curl
# Set the working directory
WORKDIR ${SPHINX_APP_DIR}
# Copy the project files into the container
COPY ${SPHINX_SOURCE_DIR_RELATIVE} ${SPHINX_APP_DIR}
# Install Python packages via requirements.txt
RUN cd ${SPHINX_EXEC_DIR} && pip install --upgrade pip && pip install -r requirements.txt
# Build the HTML documentation using Sphinx with the defined directories
RUN cd ${SPHINX_EXEC_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", "${SPHINX_BUILD_DIR}"]

View File

@@ -8,7 +8,8 @@ services:
SPHINX_BUILD_DIR: {{docker_output_dir}}
SPHINX_EXEC_DIR: {{docker_exec_dir}}
SPHINX_APP_DIR: {{docker_app_dir}}
SPINX_SOURCE_DIR_RELATIVE: {{host_sphinx_source_dir_relative}}
SPHINX_SOURCE_DIR_RELATIVE: {{host_sphinx_source_dir_relative}}
DOCKER_PYTHON_VERSION: {{applications[application_id].version}}
ports:
- "127.0.0.1:{{ports.localhost.http[application_id]}}:8000"
healthcheck: