@@ -28,7 +28,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
2828# =============================================================================
2929# Production base builder stage: builds runtime dependencies only
3030# =============================================================================
31- FROM ghcr.io/astral-sh/uv:python3 .11-bookworm- slim AS builder-prod-base
31+ FROM python:3 .11.14- slim-bookworm AS builder-prod-base
3232ARG UID
3333ARG GID
3434
@@ -49,7 +49,10 @@ ENV UV_PYTHON_DOWNLOADS=0 \
4949 PYTHONUNBUFFERED=1 \
5050 PATH="/baserow/venv/bin:$PATH" \
5151 PYTHONPATH="/baserow/backend/src:/baserow/premium/backend/src:/baserow/enterprise/backend/src"
52-
52+
53+ # hadolint ignore=DL3022
54+ COPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /uvx /bin/
55+
5356# Create baserow directory structure (including subdirs for COPY targets)
5457RUN mkdir -p /baserow/ && chown -R $UID:$GID /baserow/
5558
@@ -84,14 +87,15 @@ ARG GID
8487USER $UID:$GID
8588WORKDIR /baserow/backend
8689
90+ COPY --chown=$UID:$GID LICENSE /baserow/LICENSE
91+ COPY --chown=$UID:$GID premium/LICENSE /baserow/premium/LICENSE
92+ COPY --chown=$UID:$GID enterprise/LICENSE /baserow/enterprise/LICENSE
93+
8794# Install dev dependencies before copying source code to leverage caching
8895RUN --mount=type=cache,target=$UV_CACHE_DIR,sharing=locked,uid=$UID,gid=$GID \
89- --mount=type=bind,source=LICENSE,target=/baserow/LICENSE \
9096 --mount=type=bind,source=backend/uv.lock,target=/baserow/backend/uv.lock \
9197 --mount=type=bind,source=backend/pyproject.toml,target=/baserow/backend/pyproject.toml \
92- --mount=type=bind,source=premium/LICENSE,target=/baserow/premium/LICENSE \
9398 --mount=type=bind,source=premium/backend/pyproject.toml,target=/baserow/premium/backend/pyproject.toml \
94- --mount=type=bind,source=enterprise/LICENSE,target=/baserow/enterprise/LICENSE \
9599 --mount=type=bind,source=enterprise/backend/pyproject.toml,target=/baserow/enterprise/backend/pyproject.toml \
96100 uv sync --frozen --no-install-workspace --no-install-project \
97101 && find /baserow/venv -type f \( -name "*.c" -o -name "*.h" \) -not -path "*/autobahn/*" -delete \
@@ -102,16 +106,12 @@ RUN --mount=type=cache,target=$UV_CACHE_DIR,sharing=locked,uid=$UID,gid=$GID \
102106 && (find /baserow/venv/lib -type d \( -name "doc" -o -name "docs" -o -name "example" -o -name "examples" \) \
103107 -not -path "*/botocore/*" -not -path "*/boto3/*" -prune -exec rm -rf {} \; || true)
104108
105- COPY --link -- from=tool-builder /usr/bin/dos2unix /usr/local/bin/dos2unix
109+ COPY --from=tool-builder /usr/bin/dos2unix /usr/local/bin/dos2unix
106110
107111# Copy source code and tests
108- COPY --chown=$UID:$GID LICENSE /baserow/LICENSE
109- COPY --chown=$UID:$GID backend /baserow/backend
110112
111- COPY --chown=$UID:$GID premium/LICENSE /baserow/premium/LICENSE
113+ COPY --chown=$UID:$GID backend /baserow/backend
112114COPY --chown=$UID:$GID premium/backend /baserow/premium/backend
113-
114- COPY --chown=$UID:$GID enterprise/LICENSE /baserow/enterprise/LICENSE
115115COPY --chown=$UID:$GID enterprise/backend /baserow/enterprise/backend
116116
117117COPY --chown=$UID:$GID tests /baserow/tests
@@ -140,7 +140,7 @@ FROM builder-prod-base AS builder-prod
140140ARG UID
141141ARG GID
142142
143- COPY --link -- from=tool-builder /usr/bin/dos2unix /usr/local/bin/dos2unix
143+ COPY --from=tool-builder /usr/bin/dos2unix /usr/local/bin/dos2unix
144144
145145USER $UID:$GID
146146WORKDIR /baserow/backend
@@ -173,7 +173,7 @@ RUN --mount=type=cache,target=$UV_CACHE_DIR,sharing=locked,uid=$UID,gid=$GID \
173173# =============================================================================
174174# CI Target - lightweight image for pytest and E2E tests
175175# =============================================================================
176- FROM ghcr.io/astral-sh/uv:python3 .11-bookworm- slim AS ci
176+ FROM python:3 .11.14- slim-bookworm AS ci
177177ARG UID
178178ARG GID
179179
@@ -196,15 +196,17 @@ ENV DOCKER_USER=baserow_docker_user \
196196RUN groupadd --system --gid $GID ${DOCKER_USER} && \
197197 useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER}
198198
199- COPY --link --from=tool-builder /usr/local/bin/su-exec /usr/local/bin/su-exec
200- COPY --link --from=tool-builder /usr/bin/tini /usr/bin/tini
199+ COPY --from=tool-builder /usr/local/bin/su-exec /usr/local/bin/su-exec
200+ COPY --from=tool-builder /usr/bin/tini /usr/bin/tini
201+ # hadolint ignore=DL3022
202+ COPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /uvx /bin/
201203
202204# Create baserow directory structure (including subdirs for COPY targets)
203205RUN mkdir -p /baserow/backend/reports /baserow/premium/backend /baserow/enterprise/backend /baserow/media && \
204206 chown -R $UID:$GID /baserow/
205207
206208# Copy the virtual environment and source code with tests
207- COPY --link --from=builder-ci /baserow /baserow
209+ COPY --chown=$UID:$GID --from=builder-ci /baserow /baserow
208210COPY --chown=$UID:$GID deploy/plugins/*.sh /baserow/plugins/
209211
210212USER $UID:$GID
@@ -217,7 +219,7 @@ ENTRYPOINT ["/usr/bin/tini", "--", "/bin/bash", "/baserow/backend/docker/docker-
217219# Only works mounting the source code as a bind mount. See docker-compose.dev.yml for usage.
218220# =============================================================================
219221
220- FROM ghcr.io/astral-sh/uv:python3 .11-bookworm- slim AS dev
222+ FROM python:3 .11.14- slim-bookworm AS dev
221223ARG UID="9999"
222224ARG GID="9999"
223225
@@ -258,9 +260,11 @@ RUN getent group $GID || groupadd --system --gid $GID ${DOCKER_USER} && \
258260 echo "${DOCKER_USER} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${DOCKER_USER} && \
259261 chmod 0440 /etc/sudoers.d/${DOCKER_USER}
260262
261- COPY --link --from=tool-builder /usr/local/bin/su-exec /usr/local/bin/su-exec
262- COPY --link --from=tool-builder /usr/bin/tini /usr/bin/tini
263- COPY --link --from=tool-builder /usr/bin/dos2unix /usr/local/bin/dos2unix
263+ COPY --from=tool-builder /usr/local/bin/su-exec /usr/local/bin/su-exec
264+ COPY --from=tool-builder /usr/bin/tini /usr/bin/tini
265+ COPY --from=tool-builder /usr/bin/dos2unix /usr/local/bin/dos2unix
266+ # hadolint ignore=DL3022
267+ COPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /uvx /bin/
264268
265269# Create directory structure to install dependencies
266270RUN mkdir -p /baserow/backend/docker /baserow/premium/ /baserow/enterprise/ /baserow/media && \
@@ -280,11 +284,9 @@ RUN --mount=type=cache,target=$UV_CACHE_DIR,sharing=locked,uid=$UID,gid=$GID \
280284 --mount=type=bind,source=enterprise/backend/pyproject.toml,target=/baserow/enterprise/backend/pyproject.toml \
281285 uv sync --frozen --no-install-workspace --no-install-project
282286
283- # Configure tmux to preserve environment variables (don't start login shell)
284- RUN echo 'set -g default-command "${SHELL}"' > /baserow/.tmux.conf
285-
286- # Create .bashrc with environment variables for interactive shells
287- RUN printf '%s\n ' \
287+ # Configure tmux and bashrc
288+ RUN echo "set -g default-command \"\$ {SHELL}\" " > /baserow/.tmux.conf && \
289+ printf '%s\n ' \
288290 '# Aliases' \
289291 'alias j="just"' \
290292 'alias m="python /baserow/backend/src/baserow/manage.py"' \
@@ -311,7 +313,7 @@ CMD ["django-dev"]
311313# =============================================================================
312314# Production target
313315# =============================================================================
314- FROM python:3.11-slim-bookworm AS local
316+ FROM python:3.11.14 -slim-bookworm AS local
315317ARG UID
316318ARG GID
317319
@@ -341,18 +343,18 @@ RUN groupadd --system --gid $GID ${DOCKER_USER} && \
341343
342344# In slim docker images, mime.types is removed and we need it for mimetypes guessing
343345COPY ./backend/docker/mime.types /etc/
344- COPY --link -- from=tool-builder /usr/local/bin/su-exec /usr/local/bin/su-exec
345- COPY --link -- from=tool-builder /usr/bin/tini /usr/bin/tini
346+ COPY --from=tool-builder /usr/local/bin/su-exec /usr/local/bin/su-exec
347+ COPY --from=tool-builder /usr/bin/tini /usr/bin/tini
346348
347349RUN mkdir -p /baserow/media && chown -R $UID:$GID /baserow/
348350
349351# Copy the virtual environment with the production dependencies
350- COPY --link --from=builder-prod /baserow/venv /baserow/venv/
352+ COPY --chown=$UID:$GID --from=builder-prod /baserow/venv /baserow/venv/
351353
352354COPY --chown=$UID:$GID LICENSE /baserow/LICENSE
353- COPY --link --from=builder-prod /baserow/backend /baserow/backend/
354- COPY --link --from=builder-prod /baserow/premium /baserow/premium/
355- COPY --link --from=builder-prod /baserow/enterprise /baserow/enterprise/
355+ COPY --chown=$UID:$GID --from=builder-prod /baserow/backend /baserow/backend/
356+ COPY --chown=$UID:$GID --from=builder-prod /baserow/premium /baserow/premium/
357+ COPY --chown=$UID:$GID --from=builder-prod /baserow/enterprise /baserow/enterprise/
356358
357359COPY --chown=$UID:$GID deploy/plugins/*.sh /baserow/plugins/
358360
0 commit comments