Spaces:
Running
Running
tomas-gajarsky
commited on
Commit
·
ed9eec4
1
Parent(s):
aa66494
Create Dockerfile.gpu
Browse files- Dockerfile.gpu +40 -0
Dockerfile.gpu
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM nvidia/cuda:11.7.0-runtime-ubuntu20.04
|
2 |
+
|
3 |
+
RUN useradd -ms /bin/bash admin
|
4 |
+
RUN chown -R admin:admin $WORKDIR
|
5 |
+
RUN chmod 755 $WORKDIR
|
6 |
+
|
7 |
+
# Set working directory
|
8 |
+
ENV WORKDIR=/code
|
9 |
+
WORKDIR $WORKDIR
|
10 |
+
|
11 |
+
# Install base utilities
|
12 |
+
RUN apt-get update && apt-get install -y \
|
13 |
+
software-properties-common && \
|
14 |
+
apt-get clean && rm -rf /var/lib/apt/lists/*
|
15 |
+
|
16 |
+
# Install Python 3.9 from ppa
|
17 |
+
RUN add-apt-repository ppa:deadsnakes/ppa
|
18 |
+
RUN apt install -y \
|
19 |
+
python3.9 \
|
20 |
+
python3-pip
|
21 |
+
|
22 |
+
# Link python3.9 to python3 and python
|
23 |
+
RUN ln -sf /usr/bin/python3.9 /usr/bin/python3 & \
|
24 |
+
ln -sf /usr/bin/python3 /usr/bin/python & \
|
25 |
+
ln -sf /usr/bin/pip3 /usr/bin/pip
|
26 |
+
RUN pip install --upgrade pip
|
27 |
+
|
28 |
+
|
29 |
+
COPY requirements.txt $WORKDIR/requirements.txt
|
30 |
+
|
31 |
+
RUN pip install gradio --no-cache-dir
|
32 |
+
RUN pip install --no-cache-dir --upgrade -r $WORKDIR/requirements.txt
|
33 |
+
|
34 |
+
COPY . .
|
35 |
+
|
36 |
+
USER admin
|
37 |
+
|
38 |
+
EXPOSE 7860
|
39 |
+
|
40 |
+
ENTRYPOINT ["python", "app.py", "--path-conf", "config.merged.gpu.yml"]
|