39 lines
No EOL
1.1 KiB
Docker
39 lines
No EOL
1.1 KiB
Docker
FROM nginx:alpine
|
|
|
|
# Set environment variables
|
|
ENV PORT="80"
|
|
ENV VIRTUAL_ENV="/mkdocs"
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
|
|
# 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 |