Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +36 -0
Dockerfile
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# base image: CUDA 12.1
|
2 |
+
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
|
3 |
+
|
4 |
+
# install necessary packages
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
git \
|
7 |
+
wget \
|
8 |
+
curl \
|
9 |
+
ca-certificates \
|
10 |
+
libglib2.0-0 \
|
11 |
+
libsm6 \
|
12 |
+
libxrender1 \
|
13 |
+
libxext6 \
|
14 |
+
libssl-dev \
|
15 |
+
libffi-dev \
|
16 |
+
python3 \
|
17 |
+
python3-pip \
|
18 |
+
&& rm -rf /var/lib/apt/lists/*
|
19 |
+
|
20 |
+
|
21 |
+
# set python3 as default python
|
22 |
+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
23 |
+
|
24 |
+
RUN useradd -m -u 1000 user
|
25 |
+
USER user
|
26 |
+
WORKDIR /app
|
27 |
+
|
28 |
+
RUN pip install --upgrade pip setuptools
|
29 |
+
RUN pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu121
|
30 |
+
|
31 |
+
COPY --chown=user requirements.txt train.py README.md ./
|
32 |
+
RUN pip install -r requirements.txt
|
33 |
+
|
34 |
+
ENV PYTHONUNBUFFERED=1
|
35 |
+
|
36 |
+
CMD ["python", "train.py"]
|