monolang/mkdocs-git.containerfile: update
Changed python env from systemwide apk-managed to pip virtual env.
This commit is contained in:
parent
4909263f5d
commit
7b7ed899fb
1 changed files with 33 additions and 12 deletions
|
@ -1,25 +1,46 @@
|
||||||
FROM nginx:alpine
|
FROM python:alpine
|
||||||
|
|
||||||
|
# Set environment variables
|
||||||
ENV PORT="80"
|
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 \
|
# Install necessary packages
|
||||||
&& touch /docker-entrypoint.d/port.sh \
|
RUN apk add --no-cache git nginx envsubst
|
||||||
&& 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
|
|
||||||
|
|
||||||
|
# Create work directory
|
||||||
RUN mkdir /mkdocs
|
RUN mkdir /mkdocs
|
||||||
WORKDIR /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 root /etc/crontabs/root
|
||||||
COPY mkdocs-git /bin/mkdocs-git
|
COPY mkdocs-git /bin/mkdocs-git
|
||||||
RUN chmod 744 /bin/mkdocs-git
|
RUN chmod 744 /bin/mkdocs-git
|
||||||
|
|
||||||
|
# Configure cron entrypoints
|
||||||
RUN touch /docker-entrypoint.d/cron.sh \
|
RUN touch /docker-entrypoint.d/cron.sh \
|
||||||
&& echo "exec crond" > /docker-entrypoint.d/cron.sh \
|
&& echo "exec crond" > /docker-entrypoint.d/cron.sh \
|
||||||
&& chmod 776 /docker-entrypoint.d/cron.sh
|
&& chmod 776 /docker-entrypoint.d/cron.sh
|
||||||
|
|
||||||
|
# Expose the port
|
||||||
|
EXPOSE $PORT
|
||||||
|
|
||||||
|
# Start Nginx
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
Loading…
Add table
Add a link
Reference in a new issue