1
1
# Build in a full featured container
2
2
ARG TARGETARCH
3
+ FROM --platform=linux/$TARGETARCH ghcr.io/astral-sh/uv:latest AS uv
3
4
FROM --platform=linux/$TARGETARCH python:3.11-bullseye AS build
4
5
5
6
# Install protobuf compiler
6
7
RUN apt-get update \
7
- && DEBIAN_FRONTEND=noninteractive \
8
+ && DEBIAN_FRONTEND=noninteractive \
8
9
apt-get install --no-install-recommends --assume-yes \
9
- protobuf-compiler=3.12.4-1+deb11u1 libprotobuf-dev=3.12.4-1+deb11u1
10
+ protobuf-compiler=3.12.4-1+deb11u1 libprotobuf-dev=3.12.4-1+deb11u1
10
11
11
12
# Get go compiler
12
13
ARG TARGETARCH
@@ -20,7 +21,7 @@ RUN wget -q -O - https://sh.rustup.rs | sh -s -- -y
20
21
ENV PATH="$PATH:/root/.cargo/bin"
21
22
22
23
# Install uv
23
- COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
24
+ COPY --from=uv /uv /uvx /bin/
24
25
25
26
WORKDIR /app
26
27
@@ -46,10 +47,14 @@ COPY workers/python ./workers/python
46
47
# Build the worker
47
48
RUN CGO_ENABLED=0 ./temporal-omes prepare-worker --language python --dir-name prepared --version "$SDK_VERSION"
48
49
50
+ # Download the worker dependencies for offline use
51
+ WORKDIR /app/workers/python/prepared
52
+ RUN uv lock && uv sync --frozen
53
+
49
54
# Copy the CLI and built worker to a distroless "run" container
50
55
FROM --platform=linux/$TARGETARCH python:3.11-slim-bullseye
51
56
52
- COPY --from=build /bin/ uv /bin/uv
57
+ COPY --from=uv / uv /uvx / bin/
53
58
COPY --from=build /app/temporal-omes /app/temporal-omes
54
59
COPY --from=build /app/workers/python /app/workers/python
55
60
0 commit comments