-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (32 loc) · 1.48 KB
/
Dockerfile
File metadata and controls
45 lines (32 loc) · 1.48 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
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=libs . libs
COPY --link --from=data_migration . interactive_ai/data_migration
WORKDIR /interactive_ai/migration_job
COPY --link --from=ghcr.io/astral-sh/uv:0.6.12@sha256:515b886e8eb99bcf9278776d8ea41eb4553a794195ef5803aa7ca6258653100d /uv /bin/uv
COPY --link migration_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 ffmpeg and curl
RUN apt-get update && \
apt-get install -y --no-install-recommends ffmpeg=7:5.1.*-0+deb12u1 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 --link --from=build --chown=10001 /interactive_ai/migration_job /interactive_ai/migration_job
ARG VENV="/interactive_ai/migration_job/.venv"
ENV PATH="$VENV/bin:$PATH"
ENV PYTHONPATH="/interactive_ai"
USER non-root
WORKDIR /interactive_ai/migration_job
COPY --link --chown=10001 entrypoint.sh /interactive_ai/migration_job
ENTRYPOINT [ "./entrypoint.sh"]