Skip to content

Commit 623d07c

Browse files
committed
Use python:3.12-alpine
1 parent 0b79bd1 commit 623d07c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
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
85
FROM 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

129
COPY pyproject.toml README.md /
1310

14-
RUN --mount=type=cache,target=/var/cache/apt apt install -y gcc git
1511
RUN --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
2622
FROM base as panel
2723
# Allow statements and log messages to immediately appear in the Knative logs
28-
ENV PYTHONUNBUFFERED True
24+
ENV PYTHONUNBUFFERED=True
2925
ENV PYTHONPATH=/app/src
3026
ENV PYTHONIOENCODING=utf-8
31-
ENV ENV=production
3227
ENV MPLCONFIGDIR=/tmp/matplotlib
3328
EXPOSE 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/
3631
COPY --from=builder /usr/local/bin/panel /usr/local/bin/panel
3732
COPY --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+
4036
USER app
4137
WORKDIR /app
4238

0 commit comments

Comments
 (0)