Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +58 -0
Dockerfile
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM nvidia/cuda:11.7.1-cudnn8-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 |
+
RUN useradd -m -u 1000 user
|
30 |
+
USER user
|
31 |
+
ENV HOME=/home/user \
|
32 |
+
PATH=/home/user/.local/bin:${PATH}
|
33 |
+
WORKDIR ${HOME}/app
|
34 |
+
|
35 |
+
RUN curl https://pyenv.run | bash
|
36 |
+
ENV PATH=${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:${PATH}
|
37 |
+
ARG PYTHON_VERSION=3.10.12
|
38 |
+
RUN pyenv install ${PYTHON_VERSION} && \
|
39 |
+
pyenv global ${PYTHON_VERSION} && \
|
40 |
+
pyenv rehash && \
|
41 |
+
pip install --no-cache-dir -U pip setuptools wheel
|
42 |
+
|
43 |
+
COPY --chown=1000 ./requirements.txt /tmp/requirements.txt
|
44 |
+
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt && \
|
45 |
+
mim install mmcv==2.0.1 && \
|
46 |
+
mim install mmdet==3.1.0 && \
|
47 |
+
mim install mmpose==1.1.0
|
48 |
+
|
49 |
+
COPY --chown=1000 . ${HOME}/app
|
50 |
+
ENV PYTHONPATH=${HOME}/app \
|
51 |
+
PYTHONUNBUFFERED=1 \
|
52 |
+
GRADIO_ALLOW_FLAGGING=never \
|
53 |
+
GRADIO_NUM_PORTS=1 \
|
54 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
55 |
+
GRADIO_THEME=huggingface \
|
56 |
+
SYSTEM=spaces
|
57 |
+
CMD ["python", "app.py"]
|
58 |
+
|