Yehor commited on
Commit
7b80724
·
verified ·
1 Parent(s): 4430426

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -16
Dockerfile CHANGED
@@ -26,29 +26,26 @@ RUN apt-get update && \
26
  liblzma-dev \
27
  # gradio dependencies \
28
  ffmpeg \
 
 
29
  && apt-get clean \
30
  && rm -rf /var/lib/apt/lists/*
31
 
 
 
 
 
 
 
 
 
32
 
33
- RUN useradd -m -u 1001 user
34
- USER user
35
- ENV HOME=/home/user \
36
- PATH=/home/user/.local/bin:${PATH}
37
  WORKDIR ${HOME}/app
38
 
39
- RUN curl https://pyenv.run | bash
40
- ENV PATH=${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:${PATH}
41
- ARG PYTHON_VERSION=3.13.2
42
- RUN pyenv install ${PYTHON_VERSION} && \
43
- pyenv global ${PYTHON_VERSION} && \
44
- pyenv rehash && \
45
- pip install --no-cache-dir -U pip setuptools wheel && \
46
- pip install packaging ninja
47
 
48
- COPY --chown=1001 ./requirements.txt /tmp/requirements.txt
49
- RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt
50
 
51
- COPY --chown=1001 . ${HOME}/app
52
  ENV PYTHONPATH=${HOME}/app \
53
  PYTHONUNBUFFERED=1 \
54
  GRADIO_ALLOW_FLAGGING=never \
@@ -57,4 +54,4 @@ ENV PYTHONPATH=${HOME}/app \
57
  GRADIO_THEME=huggingface \
58
  SYSTEM=spaces
59
 
60
- CMD ["python", "app.py"]
 
26
  liblzma-dev \
27
  # gradio dependencies \
28
  ffmpeg \
29
+ # uv \
30
+ curl -LsSf https://astral.sh/uv/install.sh | sh \
31
  && apt-get clean \
32
  && rm -rf /var/lib/apt/lists/*
33
 
34
+ RUN useradd -m -u 1001 hf-space
35
+
36
+ USER hf-space
37
+
38
+ ENV HOME=/home/hf-space \
39
+ PATH=/home/hf-space/.local/bin:${PATH}
40
+
41
+ COPY --chown=1001 . ${HOME}/app
42
 
 
 
 
 
43
  WORKDIR ${HOME}/app
44
 
45
+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
 
 
 
 
 
 
 
46
 
47
+ RUN uv pip install --no-cache-dir -r /tmp/requirements.txt
 
48
 
 
49
  ENV PYTHONPATH=${HOME}/app \
50
  PYTHONUNBUFFERED=1 \
51
  GRADIO_ALLOW_FLAGGING=never \
 
54
  GRADIO_THEME=huggingface \
55
  SYSTEM=spaces
56
 
57
+ CMD ["/home/hf-space/app/.venv/bin/python", "app.py"]