diff --git a/backend/Dockerfile b/backend/Dockerfile
index 59b3cf5bc..0d6277831 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -1,3 +1,4 @@
+# syntax = docker/dockerfile:1.3
 FROM debian:buster-slim as base
 
 ARG UID
@@ -41,15 +42,17 @@ COPY --chown=$UID:$GID ./backend/docker/mime.types /etc/
 COPY --chown=$UID:$GID ./backend/requirements/base.txt /baserow/requirements/
 RUN python3 -m pip install --no-cache-dir --no-warn-script-location --disable-pip-version-check --upgrade pip==22.0.3
 RUN python3 -m pip install --no-cache-dir --no-warn-script-location --upgrade virtualenv==20.13.1 && python3 -m virtualenv /baserow/venv
-# hadolint ignore=SC1091
-RUN . /baserow/venv/bin/activate && pip3 install --no-cache-dir -r /baserow/requirements/base.txt
+
+ENV PIP_CACHE_DIR=/tmp/baserow_pip_cache
+# hadolint ignore=SC1091,DL3042
+RUN --mount=type=cache,mode=777,target=$PIP_CACHE_DIR,uid=$UID,gid=$GID . /baserow/venv/bin/activate && pip3 install  -r /baserow/requirements/base.txt
 
 # Build a dev_deps stage which also has the dev dependencies for use by the dev layer.
 FROM base as dev_deps
 
 COPY ./backend/requirements/dev.txt /baserow/requirements/
-# hadolint ignore=SC1091
-RUN . /baserow/venv/bin/activate && pip3 install --no-cache-dir -r /baserow/requirements/dev.txt
+# hadolint ignore=SC1091,DL3042
+RUN --mount=type=cache,mode=777,target=$PIP_CACHE_DIR,uid=$UID,gid=$GID . /baserow/venv/bin/activate && pip3 install -r /baserow/requirements/dev.txt
 
 # The core stage contains all of Baserows source code and sets up the entrypoint
 FROM base as core