This commit is contained in:
2026-06-05 11:37:27 +05:00
parent af66306db0
commit 92be7b9965
7 changed files with 238 additions and 104 deletions
+28 -36
View File
@@ -1,55 +1,47 @@
FROM alpine:3.16 AS builder
FROM alpine:3.20 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
ENV PYTHONUNBUFFERED=1
RUN \
apk add --update \
RUN apk add --no-cache \
ca-certificates \
bash \
git \
openssh \
python3 \
python3-dev \
py3-setuptools \
py-pip \
build-base
ADD docker/container-files/ /
py3-pip \
build-base \
weasyprint
RUN python -m venv /src/env
# Enable venv
ENV PATH="/src/env/bin:$PATH"
ADD requirements.txt /src/
WORKDIR /src
RUN \
pip install --upgrade pip && \
pip install --ignore-installed -r /src/requirements.txt && \
cd /bootstrap && pip install -e /bootstrap && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/* && \
chmod 600 /root/.ssh/config
COPY requirements.txt /src/
RUN pip install --upgrade pip && \
pip install -r /src/requirements.txt && \
rm -rf /tmp/* /var/cache/apk/*
# Копируем bootstrap, если он у тебя критично нужен
COPY docker/container-files/ /
CMD ["/usr/bin/bootstrap", "start"]
FROM builder as makestatic
ADD docs /src/docs/
#ADD overrides /src/overrides/
ADD mkdocs.yml /src/
ENV PATH="/src/env/bin:$PATH"
RUN cd /src && properdocs build
#RUN cd /src && mkdocs build
COPY docs /src/docs/
COPY zensical.toml /src/ # новый конфиг
COPY mkdocs.yml /src/ # оставляем на всякий случай
COPY custom_theme /src/overrides/ 2>/dev/null || true
COPY css /src/css/ 2>/dev/null || true
COPY javascripts /src/javascripts/ 2>/dev/null || true
RUN cd /src && zensical build --config-file zensical.toml
FROM nginx:alpine
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
COPY --from=makestatic /src/site /sites/app.lexema.ru/docs
EXPOSE 80