Feat: pre-install all requirements in the docker image
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 3 Nov 2024 13:47:28 +0000 (14:47 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 3 Nov 2024 13:47:28 +0000 (14:47 +0100)
comes at a cost of a slightly larger image size but is faster to start because we do not have to install dependencies at runtime

Dockerfile

index 3f942aa8e8428b607fead6022fe1bf8008269622..443c657557b4e11442423d6a4c5ddc56ed434c33 100644 (file)
@@ -11,6 +11,16 @@ FROM ghcr.io/music-assistant/base:$BASE_IMAGE_VERSION
 ARG MASS_VERSION
 ARG TARGETPLATFORM
 ADD dist dist
+
+# pre-install ALL requirements
+# comes at a cost of a slightly larger image size but is faster to start
+# and has less dependencies to install at runtime
+COPY requirements_all.txt .
+RUN uv pip install \
+    --no-cache \
+    --find-links "https://wheels.home-assistant.io/musllinux/" \
+    -r requirements_all.txt
+
 # Install Music Assistant from prebuilt wheel
 RUN uv pip install \
     --no-cache \