fix: Update Python base images to version 3.12 in build configuration
Some checks failed
Deploy to GitHub Pages / build (push) Has been cancelled
Deploy to GitHub Pages / deploy (push) Has been cancelled

refactor: Improve Dockerfile by adding necessary build tools and cleaning up
This commit is contained in:
2026-03-07 11:59:31 +01:00
parent 14be205eb1
commit f94f6a686d
2 changed files with 17 additions and 10 deletions

View File

@@ -1,11 +1,15 @@
ARG BUILD_FROM ARG BUILD_FROM
FROM $BUILD_FROM FROM $BUILD_FROM
# Install Bluetooth system libraries (BlueZ for BLE/RFCOMM) # System libraries: BlueZ for BLE/RFCOMM + build tools for numpy & pillow
RUN apk add --no-cache \ RUN apk add --no-cache \
bluez \ bluez \
bluez-deprecated \ dbus \
dbus gcc \
musl-dev \
libjpeg-turbo-dev \
zlib-dev \
libffi-dev
# Install Python runtime dependencies # Install Python runtime dependencies
RUN pip3 install --no-cache-dir --break-system-packages \ RUN pip3 install --no-cache-dir --break-system-packages \
@@ -16,6 +20,9 @@ RUN pip3 install --no-cache-dir --break-system-packages \
"uvicorn[standard]>=0.29" \ "uvicorn[standard]>=0.29" \
"python-multipart>=0.0.9" "python-multipart>=0.0.9"
# Remove build-only packages to keep the image slim
RUN apk del gcc musl-dev libffi-dev
# Copy the fichero Python package into the container # Copy the fichero Python package into the container
WORKDIR /app WORKDIR /app
COPY fichero/ /app/fichero/ COPY fichero/ /app/fichero/
@@ -23,8 +30,8 @@ COPY fichero/ /app/fichero/
# Make the package importable without installation # Make the package importable without installation
ENV PYTHONPATH=/app ENV PYTHONPATH=/app
# Copy and register the startup script # Copy startup script and normalise line endings (Windows CRLF -> LF)
COPY run.sh /usr/bin/run.sh COPY run.sh /usr/bin/run.sh
RUN chmod +x /usr/bin/run.sh RUN sed -i 's/\r//' /usr/bin/run.sh && chmod +x /usr/bin/run.sh
CMD ["/usr/bin/run.sh"] CMD ["/usr/bin/run.sh"]

View File

@@ -1,6 +1,6 @@
build_from: build_from:
aarch64: "ghcr.io/home-assistant/aarch64-base-python:3.13" aarch64: "ghcr.io/home-assistant/aarch64-base-python:3.12"
amd64: "ghcr.io/home-assistant/amd64-base-python:3.13" amd64: "ghcr.io/home-assistant/amd64-base-python:3.12"
armhf: "ghcr.io/home-assistant/armhf-base-python:3.13" armhf: "ghcr.io/home-assistant/armhf-base-python:3.12"
armv7: "ghcr.io/home-assistant/armv7-base-python:3.13" armv7: "ghcr.io/home-assistant/armv7-base-python:3.12"
i386: "ghcr.io/home-assistant/i386-base-python:3.13" i386: "ghcr.io/home-assistant/i386-base-python:3.12"