Docker: Download and pre-build wheels
@@ -14,6 +14,17 @@ install -p /usr/lib/libcap-ng.so.0 ./usr/lib
install -p /usr/sbin/usermod /usr/sbin/groupmod ./usr/bin
eot
+FROM base AS wheels
+# Download wheels/sources
+RUN \
+ --mount=type=cache,id=pip,target=/root/.cache/pip \
+ --mount=type=bind,source=./requirements.txt,target=./requirements.txt \
+ pip download --dest /wheels -r requirements.txt
+# Build missing wheels
+RUN \
+ --mount=type=cache,id=pip,target=/root/.cache/pip \
+ pip wheel $(ls /wheels/*.gz /wheels/*.zip 2>/dev/null) --wheel-dir=/wheels
+
# Install app dependencies
FROM base AS build
RUN apk add git
