-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (28 loc) · 792 Bytes
/
Dockerfile
File metadata and controls
41 lines (28 loc) · 792 Bytes
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
# Base Stage
FROM python:3.12-slim AS base
ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl pipx \
&& rm -rf /var/lib/apt/lists/* \
&& pipx install uv
WORKDIR /app
# Build Stage
FROM base AS builder
ENV PATH="/root/.local/bin:${PATH}"
ENV UV_PROJECT_ENVIRONMENT="/venv"
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-install-project
# Final Stage
FROM base AS final
ENV PATH="/root/.local/bin:${PATH}"
ENV VIRTUAL_ENV="/venv"
WORKDIR /app
# Copy venv with dependencies
COPY --from=builder /venv /venv
# Copy source code
COPY . .
# Install only the project (not dependencies)
RUN /venv/bin/pip install --no-deps -e .
ENTRYPOINT ["/venv/bin/modelbench"]