-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ci
More file actions
41 lines (31 loc) · 978 Bytes
/
Dockerfile.ci
File metadata and controls
41 lines (31 loc) · 978 Bytes
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
#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 uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="${PATH}:/root/.local/bin"
RUN uv --version
#install/build dependencies from this Python project
COPY pyproject.toml /temp
COPY uv.lock /temp
COPY mkdocs.yml /temp
COPY README.md /temp
COPY /docs /temp/docs
RUN uv sync --locked --no-install-project \
&& uv run mkdocs build
#2nd stage
FROM nginx:mainline-alpine3.20-slim
#For watchtower
# LABEL com.centurylinklabs.watchtower.enable="true"
COPY robots.txt /usr/share/nginx/html/robots.txt
COPY --from=builder /temp/site /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]