Commit
·
6f52efc
1
Parent(s):
6bc1136
update: dockerfile
Browse files- Dockerfile +8 -10
Dockerfile
CHANGED
|
@@ -2,9 +2,6 @@ FROM python:3.12-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Set UV cache directory to a writable location
|
| 6 |
-
ENV UV_CACHE_DIR=/app/.uv-cache
|
| 7 |
-
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
curl \
|
|
@@ -13,16 +10,17 @@ RUN apt-get update && apt-get install -y \
|
|
| 13 |
wget \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
-
|
| 17 |
-
COPY
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
RUN
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
|
| 25 |
-
RUN uv pip install -r requirements.txt
|
| 26 |
|
| 27 |
EXPOSE 8501
|
| 28 |
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
curl \
|
|
|
|
| 10 |
wget \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# Install UV
|
| 14 |
+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
| 15 |
|
| 16 |
+
COPY requirements.txt ./
|
| 17 |
|
| 18 |
+
# Use cache mount for UV cache and install dependencies
|
| 19 |
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
| 20 |
+
uv venv && \
|
| 21 |
+
uv pip install -r requirements.txt
|
| 22 |
|
| 23 |
+
COPY src/ ./src/
|
|
|
|
| 24 |
|
| 25 |
EXPOSE 8501
|
| 26 |
|