-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (45 loc) · 1.37 KB
/
Dockerfile
File metadata and controls
56 lines (45 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
###
### Build stage
###
FROM python:3 AS build-stage
WORKDIR /build
# Oracle Instant Client dependencies, `graphviz` for Sphinx diagram, and the rest for PDF generation
RUN apt-get update
RUN apt-get install -y \
curl \
graphviz \
latexmk \
texlive \
texlive-latex-recommended \
texlive-latex-extra \
texlive-fonts-recommended
# Suppress pip version warning
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
# Install modules required by XIST or for building the documentation
RUN pip install cssutils oracledb CherryPy Sphinx sphinxcontrib.jquery linklint pygll
# Pass version info into the container
ARG CI_COMMIT_TAG
ENV CI_COMMIT_TAG=$CI_COMMIT_TAG
ARG CI_COMMIT_REF_NAME
ENV CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME
ARG CI_COMMIT_SHA
ENV CI_COMMIT_SHA=$CI_COMMIT_SHA
ARG CI_COMMIT_SHORT_SHA
ENV CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA
# Copy everything into the container (as Sphinx autodoc needs XIST itself to be installed)
COPY . .
# Install XIST
RUN pip install -e .
# Build PDF
RUN cd docs && make doc
###
### Production stage
###
FROM nginx:alpine AS production-stage
WORKDIR /usr/share/nginx/html
RUN apk --no-cache add curl
COPY --from=build-stage /build/docs/build/html /usr/share/nginx/html/
EXPOSE 80
HEALTHCHECK --interval=60s --timeout=3s --start-period=30s \
CMD curl --fail -A "docker-healthcheck-curl" http://localhost:80/ || exit 1
CMD ["nginx", "-g", "daemon off;"]