43 lines
1.7 KiB
Docker
43 lines
1.7 KiB
Docker
# Use Debian slim for a lightweight base image
|
|
FROM debian:bookworm-slim
|
|
|
|
# Environment variables
|
|
ENV MKDOCS_VERSION=1.5.0
|
|
ENV VENV_PATH=/opt/venv
|
|
ENV PYTHONPATH="/usr/lib/python3/dist-packages:${PYTHONPATH}"
|
|
|
|
# Update & install OS dependencies
|
|
RUN apt update && apt install -y --no-install-recommends \
|
|
ca-certificates bash git openssh-client python3 python3-venv python3-pip \
|
|
build-essential libfuse3-dev libcurl4-openssl-dev libxml2-dev \
|
|
pkg-config automake autoconf libtool \
|
|
jq curl graphviz ghostscript fonts-dejavu rsync rclone fuse3 && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create a virtual environment
|
|
RUN python3 -m venv $VENV_PATH && \
|
|
$VENV_PATH/bin/pip install --upgrade pip
|
|
|
|
# Install Python dependencies via pip (flask, requests, redis, webdavclient3)
|
|
RUN $VENV_PATH/bin/pip install flask requests redis webdavclient3
|
|
|
|
# Install MkDocs & plugins inside the virtual environment
|
|
RUN $VENV_PATH/bin/pip install mkdocs==${MKDOCS_VERSION} && \
|
|
$VENV_PATH/bin/pip install mkdocs-material fontawesome-markdown mkdocs-mermaid2-plugin \
|
|
mkdocs-video mkdocs-include_dir_to_nav mkdocs-static-i18n mkdocs[i18n] \
|
|
mkdocs-asciinema mkdocs-glightbox mkdocs-encryptcontent-plugin \
|
|
mkdocs-redirects mkdocs-autolinks-plugin mkdocs-monorepo-plugin \
|
|
mkdocs-exclude mkdocs-exclude-search mkdocs-pdf-export-plugin \
|
|
mkdocs-graphviz mkdocs-charts-plugin mkdocs-diagrams
|
|
|
|
# Cleanup
|
|
RUN apt autoremove -y && apt clean && rm -rf /tmp/* /var/tmp/*
|
|
|
|
# Copy the script
|
|
COPY script_creator.py /usr/local/bin/script_creator.py
|
|
|
|
# Set the virtual environment for Python execution
|
|
ENV PATH="$VENV_PATH/bin:$PATH"
|
|
|
|
# Default command
|
|
CMD ["python3", "/usr/local/bin/script_creator.py"] |