Debian Codegraph @

Dockerfile

raw
1
2 # -- build stage, install dependencies only using `uv`
3 FROM python:3.13-alpine@sha256:399babc8b49529dabfd9c922f2b5eea81d611e4512e3ed250d75bd2e7683f4b0 AS build
4 RUN apk add gcc python3-dev musl-dev linux-headers
5 COPY requirements-build.txt /tmp/requirements-build.txt
6 RUN pip install --no-cache-dir --require-hashes -r /tmp/requirements-build.txt
7
8 WORKDIR /app
9
10 COPY . /app
11 RUN uv pip install --target=/deps .
12
13
14 # -- final image, copy dependencies and amqtt source
15 FROM python:3.13-alpine@sha256:399babc8b49529dabfd9c922f2b5eea81d611e4512e3ed250d75bd2e7683f4b0
16
17 WORKDIR /app
18
19 COPY --from=build /deps /usr/local/lib/python3.13/site-packages/
20
21 COPY ./amqtt/scripts/default_broker.yaml /app/conf/broker.yaml
22
23 EXPOSE 1883
24
25 ENV PATH="/usr/local/lib/python3.13/site-packages/bin:$PATH"
26
27 # Run `amqtt` when the container launches
28 CMD ["amqtt", "-c", "/app/conf/broker.yaml"]