@@ -26,23 +26,30 @@ RUN curl -L https://github.com/temporalio/tctl/releases/download/v1.18.1/tctl_1.
2626 chmod +x /usr/local/bin/tctl && \
2727 rm /tmp/tctl.tar.gz
2828
29- RUN uv pip install --system --upgrade pip setuptools wheel
30-
29+ ENV UV_COMPILE_BYTECODE=1
30+ ENV UV_LINK_MODE=copy
3131ENV UV_HTTP_TIMEOUT=1000
3232
33- # Copy just the pyproject.toml file to optimize caching
34- COPY {{ project_path_from_build_root }}/pyproject.toml /app/{{ project_path_from_build_root }}/pyproject.toml
35-
3633WORKDIR /app/{{ project_path_from_build_root }}
3734
38- # Install the required Python packages using uv
39- RUN uv pip install --system .
35+ # Copy dependency files for layer caching
36+ COPY {{ project_path_from_build_root }}/pyproject.toml {{ project_path_from_build_root }}/uv.lock ./
37+
38+ # Install dependencies (without project itself, for layer caching)
39+ RUN --mount=type=cache,target=/root/.cache/uv \
40+ uv sync --locked --no-install-project --no-dev
4041
4142# Copy the project code
42- COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project
43+ COPY {{ project_path_from_build_root }}/project ./project
44+
45+ # Install the project
46+ RUN --mount=type=cache,target=/root/.cache/uv \
47+ uv sync --locked --no-dev
48+
49+ ENV PATH="/app/{{ project_path_from_build_root }}/.venv/bin:$PATH"
4350
4451# Run the ACP server using uvicorn
4552CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"]
4653
4754# When we deploy the worker, we will replace the CMD with the following
48- # CMD ["python", "-m", "run_worker"]
55+ # CMD ["python", "-m", "run_worker"]
0 commit comments