-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (36 loc) · 1.65 KB
/
Dockerfile
File metadata and controls
49 lines (36 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.10-slim-bookworm@sha256:a02d127ac3e004d100268fcf394e8d673e1f43f2ac84d2f38f7d8345f18890b3 AS base
FROM base AS build
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
# Disable Python downloads, because we want to use the system interpreter across both images.
ENV UV_PYTHON_DOWNLOADS=0
# Copy the service dependencies
COPY --link --from=common . interactive_ai/workflows/common
COPY --link --from=libs . libs
COPY --link --from=iai_core . interactive_ai/libs/iai_core_py
COPY --link --from=media_utils . interactive_ai/libs/media_utils
WORKDIR /interactive_ai/workflows/workflow
COPY --link --from=ghcr.io/astral-sh/uv:0.6.12@sha256:515b886e8eb99bcf9278776d8ea41eb4553a794195ef5803aa7ca6258653100d /uv /bin/uv
COPY --link job/ job
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-dev --no-editable
FROM base AS runtime
# Install runtime dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgl1=1.6.* \
libglib2.0-0=2.74.* \
curl && \
rm -rf /var/lib/apt/lists/* && \
useradd -l -u 10001 non-root && \
pip3 uninstall -y setuptools pip wheel && \
rm -rf /root/.cache/pip
# Copy the application from the builder
COPY --link --from=build --chown=10001 /interactive_ai/workflows/workflow /interactive_ai/workflows/workflow
# Place executables in the environment at the front of the path
ENV PATH="/interactive_ai/workflows/workflow/.venv/bin:$PATH"
ENV PYTHONPATH="/interactive_ai/workflows/workflow"
USER non-root
WORKDIR /interactive_ai/workflows/workflow