File size: 929 Bytes
a67f29c
2f5127c
1f3268c
2f5127c
3b05990
6fae688
2f5127c
 
 
 
 
 
 
 
50d0b86
de783bf
2f5127c
 
7916d6c
2f5127c
 
 
fde9c4e
2f5127c
 
fde9c4e
42fa960
2f5127c
 
fde9c4e
2f5127c
3b05990
1b37cec
2f5127c
7916d6c
 
2f5127c
42fa960
 
1f3268c
e0dec4c
 
2f5127c
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# https://huggingface.co/docs/hub/en/spaces-sdks-docker-first-demo#create-the-dockerfile

FROM nvidia/cuda:12.9.0-cudnn-devel-ubuntu24.04

ENV RUNNING_IN_DOCKER=true

RUN apt-get update
RUN apt-get install -y \
  bash \
  curl \
  git \
  git-lfs \
  htop \
  procps \
  python-is-python3 \
  python3 \
  nano \
  vim \
  wget
RUN rm -fr /var/lib/apt/lists/*

WORKDIR /app
RUN chown ubuntu /app
RUN chmod 755 /app

USER ubuntu
ENV PATH="/home/ubuntu/.local/bin:${PATH}"
RUN curl -LsSf https://astral.sh/uv/install.sh | sh

COPY --chown=ubuntu . /app

ENV UV_NO_CACHE=true
RUN uv venv
RUN uv sync

SHELL ["/usr/bin/bash", "-c"]

ENV CUDA_HOME="/usr/local/cuda"
ENV PATH="${CUDA_HOME}/bin:${PATH}"

RUN source .venv/bin/activate

# `7860` is the default port for Hugging Face Spaces running on Docker
# https://huggingface.co/docs/hub/en/spaces-config-reference
CMD ["python", "-m", "http.server", "--directory", "public", "7860"]