multilang: update

Copied the changes in the monolang version to the multilang version.
This commit is contained in:
Luc Bijl 2025-07-20 19:59:57 +02:00
parent 0d93a954ee
commit bc481c8586
2 changed files with 35 additions and 10 deletions

View file

@ -1,9 +1,20 @@
#!/bin/sh
# Redirect standard error to standard output
exec 2>&1
# Activate the Python virtual environment
source ${VIRTUAL_ENV}/bin/activate
# Check if the /mkdocs/repo directory exists
# If it does not exist, clone the repository from the specified GIT_REPO_URL
find /mkdocs/repo || git clone $GIT_REPO_URL /mkdocs/repo
# Change directory to the cloned repository and pull the latest changes
cd /mkdocs/repo && git pull
# Build mkdocs using the configuration file of each lang
# The output will be directed the subsequent lang directory in /usr/share/nginx/html
for lang in $WIKI_LANG
do
mkdocs build -f /mkdocs/repo/config/${lang}/mkdocs.yml -d /usr/share/nginx/html/${lang}

View file

@ -1,25 +1,39 @@
FROM nginx:alpine
# Set environment variables
ENV PORT="80"
COPY default.conf.env /etc/nginx/conf.d/default.conf.env
ENV VIRTUAL_ENV="/mkdocs"
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN apk add envsubst \
&& touch /docker-entrypoint.d/port.sh \
&& echo "exec envsubst < /etc/nginx/conf.d/default.conf.env > /etc/nginx/conf.d/default.conf && nginx -s reload" > /docker-entrypoint.d/port.sh \
&& chmod 776 /docker-entrypoint.d/port.sh
RUN apk add git \
&& apk add mkdocs \
&& apk add mkdocs-material \
&& apk add py3-regex
# Install necessary packages
RUN apk add --no-cache git python3 envsubst
# Create work directory
RUN mkdir /mkdocs
WORKDIR /mkdocs
# Create virtual environment
RUN python -m venv $VIRTUAL_ENV
# Install necessary packages in virtual environment
RUN pip install --no-cache-dir mkdocs mkdocs-material
# Configure nginx environment
COPY default.conf.env /etc/nginx/conf.d/default.conf.env
# Configure entrypoints
RUN touch /docker-entrypoint.d/port.sh \
&& echo "exec envsubst < /etc/nginx/conf.d/default.conf.env > /etc/nginx/conf.d/default.conf && nginx -s reload" > /docker-entrypoint.d/port.sh \
&& chmod 776 /docker-entrypoint.d/port.sh
# Configure cron
COPY root /etc/crontabs/root
# Configure mkdocs-git-multilang
COPY mkdocs-git-multilang /bin/mkdocs-git-multilang
RUN chmod 744 /bin/mkdocs-git-multilang
# Configure cron entrypoints
RUN touch /docker-entrypoint.d/cron.sh \
&& echo "exec crond" > /docker-entrypoint.d/cron.sh \
&& chmod 776 /docker-entrypoint.d/cron.sh