DocERP/docker/Dockerfile

51 lines
1.3 KiB
Docker

FROM alpine:latest AS builder
ENV MKDOCS_VERSION=1.1.0 \
DOCS_DIRECTORY='/mkdocs' \
LIVE_RELOAD_SUPPORT='false' \
ADD_MODULES='false' \
FAST_MODE='false' \
PYTHONUNBUFFERED=1 \
GIT_REPO='false' \
GIT_BRANCH='master' \
AUTO_UPDATE='false' \
UPDATE_INTERVAL=15
ADD docker/container-files/ /
ADD mkdocs/requirements.txt /mkdocs/requirements.txt
RUN apk add --update \
ca-certificates \
bash \
git \
openssh \
python3 \
python3-dev \
py3-setuptools \
py-pip \
build-base \
libffi-dev cairo-dev cairo cairo-tools \
jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev
RUN python -m venv /mkdocs/env
# Enable venv
ENV PATH="/mkdocs/env/bin:$PATH"
RUN \
pip install --upgrade pip && \
pip install --ignore-installed -r /mkdocs/requirements.txt && \
cd /bootstrap && pip install -e /bootstrap && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/* && \
chmod 600 /root/.ssh/config
CMD ["/usr/bin/bootstrap", "start"]
FROM builder as makestatic
ADD docs /src/docs/
ADD mkdocs.yml /src/
ENV PATH="/src/env/bin:$PATH"
RUN cd /src && mkdocs build
FROM nginx
# RUN rm /etc/nginx/sites-enabled/default
COPY docker/default.conf /etc/nginx/conf.d/default.conf
COPY --from=makestatic /src/site /sites/app.lexema.ru/docs