Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- Dockerfile +10 -10
Dockerfile
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
FROM ghcr.io/astral-sh/uv:debian-slim
|
2 |
|
3 |
-
RUN groupadd nonroot && useradd -g nonroot nonroot
|
4 |
-
|
5 |
-
WORKDIR /home/app
|
6 |
-
|
7 |
-
RUN mkdir -p /home/nonroot/.cache/uv && \
|
8 |
-
chown -R nonroot:nonroot /home/nonroot
|
9 |
-
|
10 |
# Enable bytecode compilation, Copy from the cache instead of linking since it's a mounted volume
|
11 |
ENV UV_COMPILE_BYTECODE=1 \
|
12 |
UV_LINK_MODE=copy \
|
13 |
UV_CACHE_DIR=/home/nonroot/.cache/uv
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
# skipcq: DOK-DL3008
|
16 |
RUN apt-get update && \
|
17 |
apt-get install -qq -y --no-install-recommends espeak-ng && \
|
@@ -19,15 +19,15 @@ RUN apt-get update && \
|
|
19 |
rm -rf /var/lib/apt/lists/*
|
20 |
|
21 |
# Install the project's dependencies using the lockfile and settings
|
22 |
-
RUN --mount=type=cache,target
|
23 |
--mount=type=bind,source=uv.lock,target=uv.lock \
|
24 |
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
25 |
--mount=type=bind,source=.python-version,target=.python-version \
|
26 |
uv sync --frozen --no-install-project --no-dev
|
27 |
|
28 |
-
COPY . /home/app
|
29 |
|
30 |
-
RUN --mount=type=cache,target
|
31 |
uv sync --frozen --no-dev;
|
32 |
|
33 |
USER nonroot
|
|
|
1 |
FROM ghcr.io/astral-sh/uv:debian-slim
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|
8 |
+
RUN groupadd nonroot && \
|
9 |
+
useradd -g nonroot nonroot && \
|
10 |
+
mkdir -p ${UV_CACHE_DIR} && \
|
11 |
+
chown -R nonroot:nonroot /home/nonroot
|
12 |
+
|
13 |
+
WORKDIR /home/nonroot/app
|
14 |
+
|
15 |
# skipcq: DOK-DL3008
|
16 |
RUN apt-get update && \
|
17 |
apt-get install -qq -y --no-install-recommends espeak-ng && \
|
|
|
19 |
rm -rf /var/lib/apt/lists/*
|
20 |
|
21 |
# Install the project's dependencies using the lockfile and settings
|
22 |
+
RUN --mount=type=cache,target=${UV_CACHE_DIR} \
|
23 |
--mount=type=bind,source=uv.lock,target=uv.lock \
|
24 |
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
25 |
--mount=type=bind,source=.python-version,target=.python-version \
|
26 |
uv sync --frozen --no-install-project --no-dev
|
27 |
|
28 |
+
COPY . /home/nonroot/app
|
29 |
|
30 |
+
RUN --mount=type=cache,target=${UV_CACHE_DIR} \
|
31 |
uv sync --frozen --no-dev;
|
32 |
|
33 |
USER nonroot
|