Spaces:
Running
on
L40S
Running
on
L40S
ryanzhangfan
commited on
Commit
•
023c8b7
1
Parent(s):
cb44d0b
Create Dockerfile
Browse files- Dockerfile +59 -0
Dockerfile
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM nvidia/cuda:12.4.0-devel-ubuntu22.04
|
2 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
3 |
+
RUN apt-get update && \
|
4 |
+
apt-get upgrade -y && \
|
5 |
+
apt-get install -y --no-install-recommends \
|
6 |
+
git \
|
7 |
+
git-lfs \
|
8 |
+
wget \
|
9 |
+
curl \
|
10 |
+
# python build dependencies \
|
11 |
+
build-essential \
|
12 |
+
libssl-dev \
|
13 |
+
zlib1g-dev \
|
14 |
+
libbz2-dev \
|
15 |
+
libreadline-dev \
|
16 |
+
libsqlite3-dev \
|
17 |
+
libncursesw5-dev \
|
18 |
+
xz-utils \
|
19 |
+
tk-dev \
|
20 |
+
libxml2-dev \
|
21 |
+
libxmlsec1-dev \
|
22 |
+
libffi-dev \
|
23 |
+
liblzma-dev \
|
24 |
+
# gradio dependencies \
|
25 |
+
ffmpeg \
|
26 |
+
&& apt-get clean \
|
27 |
+
&& rm -rf /var/lib/apt/lists/*
|
28 |
+
|
29 |
+
|
30 |
+
RUN useradd -m -u 1000 user
|
31 |
+
USER user
|
32 |
+
ENV HOME=/home/user \
|
33 |
+
PATH=/home/user/.local/bin:${PATH}
|
34 |
+
WORKDIR ${HOME}/app
|
35 |
+
|
36 |
+
RUN curl https://pyenv.run | bash
|
37 |
+
ENV PATH=${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:${PATH}
|
38 |
+
ARG PYTHON_VERSION=3.10.12
|
39 |
+
RUN pyenv install ${PYTHON_VERSION} && \
|
40 |
+
pyenv global ${PYTHON_VERSION} && \
|
41 |
+
pyenv rehash && \
|
42 |
+
pip install --no-cache-dir -U pip setuptools wheel && \
|
43 |
+
pip install packaging ninja
|
44 |
+
|
45 |
+
COPY --chown=1000 ./requirements.txt /tmp/requirements.txt
|
46 |
+
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt && \
|
47 |
+
pip install flash-attn --no-build-isolation
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
COPY --chown=1000 . ${HOME}/app
|
52 |
+
ENV PYTHONPATH=${HOME}/app \
|
53 |
+
PYTHONUNBUFFERED=1 \
|
54 |
+
GRADIO_ALLOW_FLAGGING=never \
|
55 |
+
GRADIO_NUM_PORTS=1 \
|
56 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
57 |
+
GRADIO_THEME=huggingface \
|
58 |
+
SYSTEM=spaces
|
59 |
+
CMD ["python", "app.py"]
|