-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ci
37 lines (28 loc) · 912 Bytes
/
Dockerfile.ci
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
#1st stage
#pull official base image
FROM python:3.11-bullseye AS builder
#set the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions
WORKDIR /temp
#set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
#install system dependencies
RUN apt-get update && \
apt-get install -y curl
#install dependencies manager poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="${PATH}:/root/.local/bin"
RUN poetry --version
#install/build dependencies from this Python project
COPY poetry.lock pyproject.toml /temp
COPY mkdocs.yml /temp
COPY /docs /temp/docs
RUN poetry export -f requirements.txt --output requirements.txt
RUN pip install -r requirements.txt
RUN mkdocs --version
RUN mkdocs build
#2nd stage
FROM nginx:mainline-alpine3.18-slim
COPY --from=builder /temp/site /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]