MH0386 commited on
Commit
fcb36ba
·
verified ·
1 Parent(s): 7c67037

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -14
Dockerfile CHANGED
@@ -3,15 +3,10 @@ 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
- UV_CACHE_DIR=/home/nonroot/.cache/uv \
7
  GRADIO_SERVER_PORT=8080
8
 
9
- RUN groupadd nonroot && \
10
- useradd -g nonroot nonroot && \
11
- mkdir -p ${UV_CACHE_DIR} && \
12
- chown -R nonroot:nonroot /home/nonroot
13
-
14
- WORKDIR /home/nonroot/app
15
 
16
  # skipcq: DOK-DL3008
17
  RUN apt-get update && \
@@ -19,19 +14,15 @@ RUN apt-get update && \
19
  apt-get clean && \
20
  rm -rf /var/lib/apt/lists/*
21
 
22
- USER nonroot
23
-
24
  # Install the project's dependencies using the lockfile and settings
25
- RUN --mount=type=cache,target=${UV_CACHE_DIR} \
26
- --mount=type=bind,source=uv.lock,target=uv.lock \
27
  --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
28
  --mount=type=bind,source=.python-version,target=.python-version \
29
  uv sync --frozen --no-install-project --no-dev
30
 
31
- COPY . /home/nonroot/app
32
 
33
- RUN --mount=type=cache,target=${UV_CACHE_DIR} \
34
- uv sync --frozen --no-dev
35
 
36
  EXPOSE ${GRADIO_SERVER_PORT}
37
 
 
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_NO_CACHE=1 \
7
  GRADIO_SERVER_PORT=8080
8
 
9
+ WORKDIR /app
 
 
 
 
 
10
 
11
  # skipcq: DOK-DL3008
12
  RUN apt-get update && \
 
14
  apt-get clean && \
15
  rm -rf /var/lib/apt/lists/*
16
 
 
 
17
  # Install the project's dependencies using the lockfile and settings
18
+ RUN --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 . /app
24
 
25
+ RUN uv sync --frozen --no-dev
 
26
 
27
  EXPOSE ${GRADIO_SERVER_PORT}
28