2021-08-05 19:37:06 +02:00
|
|
|
# Convert .rst files to .html in temporary build container
|
2024-05-06 10:21:15 +02:00
|
|
|
FROM python:3.12.3-alpine3.19 AS build
|
2018-09-25 21:04:30 +02:00
|
|
|
|
2018-10-16 22:52:21 +02:00
|
|
|
ARG version=master
|
|
|
|
ENV VERSION=$version
|
|
|
|
|
2021-08-05 19:37:06 +02:00
|
|
|
COPY requirements.txt /requirements.txt
|
|
|
|
COPY . /docs
|
|
|
|
|
2024-05-06 11:01:54 +02:00
|
|
|
RUN set -euxo pipefail \
|
2024-05-06 11:05:16 +02:00
|
|
|
; machine="$(uname -m)" \
|
2024-06-28 12:44:29 +02:00
|
|
|
; deps="gcc musl-dev graphviz" \
|
2024-05-06 11:01:54 +02:00
|
|
|
; [[ "${machine}" != x86_64 ]] && \
|
|
|
|
deps="${deps} cargo" \
|
|
|
|
; apk add --no-cache --virtual .build-deps ${deps} \
|
|
|
|
; [[ "${machine}" == armv7* ]] && \
|
|
|
|
mkdir -p /root/.cargo/registry/index && \
|
|
|
|
git clone --bare https://github.com/rust-lang/crates.io-index.git /root/.cargo/registry/index/github.com-1285ae84e5963aae \
|
|
|
|
; pip3 install -r /requirements.txt \
|
2024-06-28 12:44:29 +02:00
|
|
|
; mkdir -p /build/$VERSION/ \
|
|
|
|
; dot -Tsvg /docs/mailu-network-diagram.dot -o /docs/contributors/mailu-network-diagram.svg \
|
2024-05-06 11:01:54 +02:00
|
|
|
; sphinx-build -W /docs /build/$VERSION \
|
|
|
|
; apk del .build-deps \
|
|
|
|
; rm -rf /root/.cargo
|
2018-09-25 21:04:30 +02:00
|
|
|
|
|
|
|
|
2021-08-05 19:37:06 +02:00
|
|
|
# Build nginx deployment image including generated html
|
2024-05-06 10:21:15 +02:00
|
|
|
FROM nginx:1.25.5-alpine
|
2021-08-05 19:37:06 +02:00
|
|
|
|
|
|
|
ARG version=master
|
2021-11-17 22:00:04 +02:00
|
|
|
ARG pinned_version=master
|
2021-08-05 19:37:06 +02:00
|
|
|
ENV VERSION=$version
|
2021-11-17 22:00:04 +02:00
|
|
|
ENV TZ Etc/UTC
|
|
|
|
LABEL version=$VERSION
|
2021-08-05 19:37:06 +02:00
|
|
|
|
|
|
|
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
COPY --from=build /build/$VERSION /build/$VERSION
|
2018-09-25 21:04:30 +02:00
|
|
|
|
2018-10-16 21:38:12 +02:00
|
|
|
EXPOSE 80/tcp
|
|
|
|
|
|
|
|
CMD nginx -g "daemon off;"
|
2024-05-06 10:21:15 +02:00
|
|
|
RUN echo $pinned_version >> /version
|