2021-08-05 19:37:06 +02:00
|
|
|
# Convert .rst files to .html in temporary build container
|
|
|
|
FROM python:3.8-alpine3.14 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
|
|
|
|
|
|
|
|
RUN apk add --no-cache --virtual .build-deps \
|
|
|
|
gcc musl-dev \
|
2019-03-31 06:56:42 +02:00
|
|
|
&& pip3 install -r /requirements.txt \
|
2021-08-05 19:37:06 +02:00
|
|
|
&& mkdir -p /build/$VERSION \
|
|
|
|
&& sphinx-build -W /docs /build/$VERSION \
|
|
|
|
&& apk del .build-deps
|
2018-09-25 21:04:30 +02:00
|
|
|
|
|
|
|
|
2021-08-05 19:37:06 +02:00
|
|
|
# Build nginx deployment image including generated html
|
|
|
|
FROM nginx:1.21-alpine
|
|
|
|
|
|
|
|
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;"
|
2021-11-18 19:21:56 +02:00
|
|
|
RUN echo $pinned_version >> /version
|