You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-11-23 22:04:47 +02:00
Optimize docs/Dockerfile
- Convert .rst to .html in temporary python:3.8-alpine3.14 build image - Remove all unused packages - Use nginx:1.21-alpine deployment image
This commit is contained in:
@@ -1,20 +1,28 @@
|
|||||||
ARG DISTRO=alpine:3.8
|
# Convert .rst files to .html in temporary build container
|
||||||
FROM $DISTRO
|
FROM python:3.8-alpine3.14 AS build
|
||||||
|
|
||||||
COPY requirements.txt /requirements.txt
|
|
||||||
|
|
||||||
ARG version=master
|
ARG version=master
|
||||||
ENV VERSION=$version
|
ENV VERSION=$version
|
||||||
|
|
||||||
RUN apk add --no-cache nginx curl python3 \
|
COPY requirements.txt /requirements.txt
|
||||||
&& pip3 install -r /requirements.txt \
|
|
||||||
&& mkdir /run/nginx
|
|
||||||
|
|
||||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
COPY . /docs
|
COPY . /docs
|
||||||
|
|
||||||
RUN mkdir -p /build/$VERSION \
|
RUN apk add --no-cache --virtual .build-deps \
|
||||||
&& sphinx-build -W /docs /build/$VERSION
|
gcc musl-dev \
|
||||||
|
&& pip3 install -r /requirements.txt \
|
||||||
|
&& mkdir -p /build/$VERSION \
|
||||||
|
&& sphinx-build -W /docs /build/$VERSION \
|
||||||
|
&& apk del .build-deps
|
||||||
|
|
||||||
|
|
||||||
|
# Build nginx deployment image including generated html
|
||||||
|
FROM nginx:1.21-alpine
|
||||||
|
|
||||||
|
ARG version=master
|
||||||
|
ENV VERSION=$version
|
||||||
|
|
||||||
|
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
COPY --from=build /build/$VERSION /build/$VERSION
|
||||||
|
|
||||||
EXPOSE 80/tcp
|
EXPOSE 80/tcp
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user