-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDockerfile
58 lines (45 loc) · 1.77 KB
/
Dockerfile
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
57
58
FROM python:3.8.0 as latest
EXPOSE 8000
WORKDIR /tmp
# If you need to build the docs without mkdocs-material-insiders
COPY requirements-no-insiders.txt /tmp
RUN pip install --no-cache-dir -r /tmp/requirements-no-insiders.txt
WORKDIR /docs
COPY . .
FROM latest as all
RUN mkdocs build -f mkdocs-5.0.yml
RUN mkdocs build -f mkdocs-4.10.yml
RUN mkdocs build -f mkdocs-4.8.yml
RUN mkdocs build -f mkdocs-deprecated.yml
RUN mkdocs build -f mkdocs-3.6.yml
RUN mkdocs build -f mkdocs-2.18.yml
RUN mkdocs build -f mkdocs-ja-4.8.yml
RUN mkdocs build -f mkdocs-tr-4.8.yml
RUN mkdocs build -f mkdocs-pt-BR-4.8.yml
RUN mkdocs build -f mkdocs-ar-4.10.yml
FROM nginx:1.18-alpine as prod
COPY --from=all /docs/site /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# If you have a token to access the mkdocs-material-insiders repo and need to run the docs with it. Comment out the above section then and uncomment the below
# ARG CLONE_INSIDERS_TOKEN
# ENV CLONE_INSIDERS_TOKEN=${CLONE_INSIDERS_TOKEN}
# COPY requirements.txt /tmp
# RUN pip install --no-cache-dir -r /tmp/requirements.txt
# RUN apt-get update && apt-get install -y pngquant
# WORKDIR /docs
# COPY . .
# FROM latest as all
# RUN INSIDERS=true mkdocs build -f mkdocs-5.0.yml
# RUN INSIDERS=true mkdocs build -f mkdocs-4.10.yml
# RUN INSIDERS=true mkdocs build -f mkdocs-4.8.yml
# RUN INSIDERS=true mkdocs build -f mkdocs-deprecated.yml
# RUN INSIDERS=true mkdocs build -f mkdocs-3.6.yml
# RUN INSIDERS=true mkdocs build -f mkdocs-2.18.yml
# RUN INSIDERS=true mkdocs build -f mkdocs-ja-4.8.yml
# RUN INSIDERS=true mkdocs build -f mkdocs-tr-4.8.yml
# RUN INSIDERS=true mkdocs build -f mkdocs-pt-BR-4.8.yml
# FROM nginx:1.18-alpine as prod
# COPY --from=all /docs/site /usr/share/nginx/html
# EXPOSE 80
# CMD ["nginx", "-g", "daemon off;"]