1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00
Mailu/docs/Dockerfile

42 lines
1.1 KiB
Docker
Raw Normal View History

# 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
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-05-06 11:01:54 +02:00
; deps="gcc musl-dev" \
; [[ "${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 \
; mkdir -p /build/$VERSION \
; sphinx-build -W /docs /build/$VERSION \
; apk del .build-deps \
; rm -rf /root/.cargo
2018-09-25 21:04:30 +02:00
# Build nginx deployment image including generated html
2024-05-06 10:21:15 +02:00
FROM nginx:1.25.5-alpine
ARG version=master
ARG pinned_version=master
ENV VERSION=$version
ENV TZ Etc/UTC
LABEL version=$VERSION
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