refactor
This commit is contained in:
@@ -1,32 +1,27 @@
|
||||
ARG BUILD_FROM
|
||||
FROM $BUILD_FROM
|
||||
|
||||
# Only dbus-dev needed to talk to the HOST BlueZ via D-Bus (host_dbus: true).
|
||||
# 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 \
|
||||
py3-numpy \
|
||||
py3-pillow \
|
||||
dbus-dev
|
||||
dbus-dev \
|
||||
build-base
|
||||
|
||||
# Pure-Python packages (bleak uses dbus-fast internally, no C compiler needed)
|
||||
RUN pip3 install --no-cache-dir --break-system-packages \
|
||||
"bleak>=0.21" \
|
||||
"fastapi>=0.111" \
|
||||
"uvicorn[standard]>=0.29" \
|
||||
"python-multipart>=0.0.9"
|
||||
|
||||
# Copy the fichero Python package into the container
|
||||
# Copy the entire project into the container.
|
||||
# This requires the Docker build context to be the root of the repository.
|
||||
WORKDIR /app
|
||||
COPY fichero/ /app/fichero/
|
||||
COPY . .
|
||||
|
||||
# Make the package importable without installation
|
||||
ENV PYTHONPATH=/app
|
||||
# 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 run.sh /usr/bin/run.sh
|
||||
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"]
|
||||
|
||||
Reference in New Issue
Block a user