ARG BUILD_FROM FROM $BUILD_FROM # Install build tools for Python packages that need compilation (numpy, pillow) # and dbus-dev for Bleak to communicate with the host's BlueZ via D-Bus. # Do NOT install bluez here - we use the host BlueZ, not our own. RUN apk add --no-cache \ bash \ python3 \ py3-pip \ dbus-dev \ build-base # Copy the entire project into the container. # This requires the Docker build context to be the root of the repository. WORKDIR /app COPY . . # Install the fichero-printer package and all its dependencies from pyproject.toml. # This makes the `fichero` and `fichero-server` commands available system-wide. RUN pip3 install --no-cache-dir --break-system-packages . # Copy startup script and normalise line endings (Windows CRLF -> LF) COPY fichero_printer/run.sh /usr/bin/run.sh RUN sed -i 's/\r//' /usr/bin/run.sh && chmod +x /usr/bin/run.sh CMD ["/usr/bin/run.sh"]