Skip to content

Commit da160bd

Browse files
authored
refactor: abstract out the python image tag (#18109)
1 parent 611459d commit da160bd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Set variables reused in Dockerfile
2+
ARG PYTHON_IMAGE_VERSION=3.13.2-slim-bookworm
3+
14
# First things first, we build an image which is where we're going to compile
25
# our static assets with. We use this stage in development.
36
FROM node:24.0.0-bookworm AS static-deps
@@ -38,7 +41,7 @@ RUN NODE_ENV=production npm run build
3841

3942

4043
# We'll build a light-weight layer along the way with just docs stuff
41-
FROM python:3.13.2-slim-bookworm AS docs
44+
FROM python:${PYTHON_IMAGE_VERSION} AS docs
4245

4346
# By default, Docker has special steps to avoid keeping APT caches in the layers, which
4447
# is good, but in our case, we're going to mount a special cache volume (kept between
@@ -105,7 +108,7 @@ USER docs
105108

106109
# Now we're going to build our actual application, but not the actual production
107110
# image that it gets deployed into.
108-
FROM python:3.13.2-slim-bookworm AS build
111+
FROM python:${PYTHON_IMAGE_VERSION} AS build
109112

110113
# Define whether we're building a production or a development image. This will
111114
# generally be used to control whether or not we install our development and
@@ -187,7 +190,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
187190

188191
# Now we're going to build our actual application image, which will eventually
189192
# pull in the static files that were built above.
190-
FROM python:3.13.2-slim-bookworm
193+
FROM python:${PYTHON_IMAGE_VERSION}
191194

192195
# Setup some basic environment variables that are ~never going to change.
193196
ENV PYTHONUNBUFFERED 1

0 commit comments

Comments
 (0)