11# # Step 1/3: Base image
2- FROM python:3.11-slim-bookworm as base
3- RUN \
4- --mount=type=cache,target=/var/cache/apt \
5- apt-get update && apt-get upgrade -y && apt install curl -y
2+ FROM python:3.12-alpine as base
63
74# # Step 2/3: Build/Install app dependencies
85FROM base as builder
96# Allow statements and log messages to immediately appear in the Knative logs
10- ENV PYTHONUNBUFFERED True
7+ ENV PYTHONUNBUFFERED= True
118
129COPY pyproject.toml README.md /
1310
14- RUN --mount=type=cache,target=/var/cache/apt apt install -y gcc git
1511RUN --mount=type=cache,mode=0777,target=/root/.cache/pip \
1612 pip install --upgrade pip setuptools wheel && \
1713 pip install -e ".[dashboard]" && \
@@ -25,18 +21,18 @@ COPY docs/_static /app/_static
2521# Step 3/3: Image
2622FROM base as panel
2723# Allow statements and log messages to immediately appear in the Knative logs
28- ENV PYTHONUNBUFFERED True
24+ ENV PYTHONUNBUFFERED= True
2925ENV PYTHONPATH=/app/src
3026ENV PYTHONIOENCODING=utf-8
31- ENV ENV=production
3227ENV MPLCONFIGDIR=/tmp/matplotlib
3328EXPOSE 8080
3429
35- COPY --from=builder /usr/local/lib/python3.11 /site-packages/ /usr/local/lib/python3.11 /site-packages/
30+ COPY --from=builder /usr/local/lib/python3.12 /site-packages/ /usr/local/lib/python3.12 /site-packages/
3631COPY --from=builder /usr/local/bin/panel /usr/local/bin/panel
3732COPY --from=builder /app /app
3833
39- RUN useradd app && usermod -a -G app app
34+ RUN addgroup -S app && adduser -S app -G app
35+
4036USER app
4137WORKDIR /app
4238
0 commit comments