mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Added sphinx docker role draft
This commit is contained in:
22
roles/docker-sphinx/templates/Dockerfile.j2
Normal file
22
roles/docker-sphinx/templates/Dockerfile.j2
Normal 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}"]
|
13
roles/docker-sphinx/templates/docker-compose.yml.j2
Normal file
13
roles/docker-sphinx/templates/docker-compose.yml.j2
Normal 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' %}
|
2
roles/docker-sphinx/templates/env.j2
Normal file
2
roles/docker-sphinx/templates/env.j2
Normal file
@@ -0,0 +1,2 @@
|
||||
SOURCE_DIR={{docker_source_dir}}
|
||||
BUILD_DIR={{docker_output_dir}}
|
Reference in New Issue
Block a user