diff --git a/monolang/mkdocs-git.containerfile b/monolang/mkdocs-git.containerfile index 6bf32ad..2cd5c7b 100644 --- a/monolang/mkdocs-git.containerfile +++ b/monolang/mkdocs-git.containerfile @@ -1,25 +1,46 @@ -FROM nginx:alpine +FROM python: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 nginx 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 COPY root /etc/crontabs/root COPY mkdocs-git /bin/mkdocs-git RUN chmod 744 /bin/mkdocs-git +# 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 \ No newline at end of file + && chmod 776 /docker-entrypoint.d/cron.sh + +# Expose the port +EXPOSE $PORT + +# Start Nginx +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file