Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- Dockerfile +9 -6
Dockerfile
CHANGED
@@ -3,8 +3,7 @@ FROM ghcr.io/astral-sh/uv:debian-slim
|
|
3 |
# Enable bytecode compilation, Copy from the cache instead of linking since it's a mounted volume
|
4 |
ENV UV_COMPILE_BYTECODE=1 \
|
5 |
UV_LINK_MODE=copy \
|
6 |
-
|
7 |
-
UV_SYSTEM_PYTHON=1 \
|
8 |
GRADIO_SERVER_PORT=8080
|
9 |
|
10 |
WORKDIR /app
|
@@ -15,12 +14,16 @@ RUN apt-get update && \
|
|
15 |
apt-get clean && \
|
16 |
rm -rf /var/lib/apt/lists/*
|
17 |
|
18 |
-
RUN --mount=type=
|
|
|
|
|
19 |
--mount=type=bind,source=.python-version,target=.python-version \
|
20 |
-
uv
|
21 |
-
uv pip install -r pyproject.toml
|
22 |
|
23 |
-
COPY
|
|
|
|
|
|
|
24 |
|
25 |
EXPOSE ${GRADIO_SERVER_PORT}
|
26 |
|
|
|
3 |
# Enable bytecode compilation, Copy from the cache instead of linking since it's a mounted volume
|
4 |
ENV UV_COMPILE_BYTECODE=1 \
|
5 |
UV_LINK_MODE=copy \
|
6 |
+
UV_CACHE_DIR=/home/nonroot/.cache/uv \
|
|
|
7 |
GRADIO_SERVER_PORT=8080
|
8 |
|
9 |
WORKDIR /app
|
|
|
14 |
apt-get clean && \
|
15 |
rm -rf /var/lib/apt/lists/*
|
16 |
|
17 |
+
RUN --mount=type=cache,target=${UV_CACHE_DIR} \
|
18 |
+
--mount=type=bind,source=uv.lock,target=uv.lock \
|
19 |
+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
20 |
--mount=type=bind,source=.python-version,target=.python-version \
|
21 |
+
uv sync --frozen --no-install-project --no-dev
|
|
|
22 |
|
23 |
+
COPY /src /app/src
|
24 |
+
|
25 |
+
RUN --mount=type=cache,target=${UV_CACHE_DIR} \
|
26 |
+
uv sync --frozen --no-dev
|
27 |
|
28 |
EXPOSE ${GRADIO_SERVER_PORT}
|
29 |
|