amqtt/Dockerfile

28 wiersze
608 B
Docker

# -- build stage, install dependencies only using `uv`
FROM python:3.13-alpine AS build
RUN apk add gcc python3-dev musl-dev linux-headers
RUN pip install uv
2025-06-07 16:21:15 +00:00
WORKDIR /app
2025-06-07 16:21:15 +00:00
COPY . /app
RUN uv pip install --target=/deps .
2025-06-07 16:21:15 +00:00
# -- final image, copy dependencies and amqtt source
FROM python:3.13-alpine
WORKDIR /app
2025-06-07 16:21:15 +00:00
COPY --from=build /deps /usr/local/lib/python3.13/site-packages/
COPY ./amqtt/scripts/default_broker.yaml /app/conf/broker.yaml
2025-06-07 16:21:15 +00:00
EXPOSE 1883
ENV PATH="/usr/local/lib/python3.13/site-packages/bin:$PATH"
# Run `amqtt` when the container launches
CMD ["amqtt", "-c", "/app/conf/broker.yaml"]