Added basic documentation server

This commit is contained in:
2024-02-11 15:26:38 -06:00
parent 065d240468
commit c93df6d0d3
10 changed files with 111 additions and 8 deletions
+19
View File
@@ -0,0 +1,19 @@
FROM docker.io/almalinux/9-minimal:latest
LABEL maintainer="n0x@n0xb0x.org"
COPY requirements.txt requirements.txt
RUN microdnf update -y \
&& microdnf install -y \
ca-certificates \
python3 \
python3-pip \
&& microdnf clean all && rm -fr /tmp/* /var/tmp/* \
&& pip3 install -r requirements.txt
EXPOSE 8081 80
WORKDIR /srv
CMD python -m http.server -d /srv/site 80
+1
View File
@@ -0,0 +1 @@
buildah bud -f Containerfile -t doc-web:1.0
+1
View File
@@ -0,0 +1 @@
site_name: My Docs
+2
View File
@@ -0,0 +1,2 @@
mkdocs==1.5.3
+5
View File
@@ -6,6 +6,11 @@
chdir: ~/Containers/bitcoin
cmd: ./build.sh
- name: rebuild_docs
ansible.builtin.shell:
chdir: ~/Containers/docs
cmd: ./build.sh
- name: reload_systemctl
ansible.builtin.systemd_service:
daemon_reload: true
+49
View File
@@ -0,0 +1,49 @@
---
# tasks file for build
#
- name: Create ~/srv/docs
ansible.builtin.file:
path: ~/srv/docs/site
state: directory
- name: Create ~/srv/docs
ansible.builtin.file:
path: ~/srv/docs/docs
state: directory
- name: Make dir for docs Containers
ansible.builtin.file:
path: ~/Containers/docs
state: directory
- name: Copy Containerfile Template
ansible.builtin.copy:
src: docs/Containerfile
dest: ~/Containers/docs/Containerfile
notify: rebuild_docs
- name: Copy build script
ansible.builtin.copy:
src: docs/build.sh
dest: ~/Containers/docs/build.sh
mode: '0700'
notify: rebuild_docs
- name: Copy requirements.txt file
ansible.builtin.copy:
src: docs/requirements.txt
dest: ~/Containers/docs/requirements.txt
notify: rebuild_docs
- name: Copy mkdocs.yml file
ansible.builtin.copy:
src: docs/mkdocs.yml
dest: ~/srv/docs/mkdocs.yml
notify: rebuild_docs
- name: Copy docs-node.container file
ansible.builtin.template:
src: docs/docs-node.container.j2
dest: /home/{{ ansible_user }}/.config/containers/systemd/docs-node.container
notify: reload_systemctl
@@ -0,0 +1,21 @@
[Unit]
Description=Documentation Server
[Container]
Image={{ registry_url }}/doc-web:1.0
PublishPort=8081:80
# Use volume
Volume=/home/{{ansible_user}}/srv/docs:/srv:Z
[Service]
# Restart service when sleep finishes
Restart=always
# Extend Timeout to allow time to pull the image
TimeoutStartSec=900
# ExecStartPre flag and other systemd commands can go here, see systemd.unit(5) man page.
# ExecStartPre=/usr/share/mincontainer/setup.sh
[Install]
# Start by default on boot
WantedBy=multi-user.target default.target