3v324v23 commited on
Commit
d8a2329
1 Parent(s): 206a8a5
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -1,12 +1,16 @@
1
  # FROM nvidia/cuda:11.1.1-devel-ubuntu20.04
2
  FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
3
 
4
- ARG USER_NAME=berfscene
 
5
 
6
  ENV CUDA_HOME=/usr/local/cuda
7
- ENV PATH=${CUDA_HOME}/bin:/home/${USER_NAME}/.local/bin:${PATH}
8
  ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
9
  ENV LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_PATH}
 
 
 
10
 
11
  # apt install by root user
12
  RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@@ -29,15 +33,11 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
29
  # RUN pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
30
  RUN pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
31
 
32
- COPY . /home/${USER_NAME}
33
- WORKDIR /home/${USER_NAME}/
34
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
35
 
36
  RUN wget https://www.dropbox.com/scl/fi/105qy7mkqfjcmnfd3tmv0/edit.pth?rlkey=qcd67cdrqz4jra0p3er966iuk -O clevr.pth
37
- RUN rm -rf ~/.cache/torch_extensions
38
 
39
- RUN mkdir -m 700 /home/${USER_NAME}/cache
40
- ENV TORCH_EXTENSIONS_DIR=/home/${USER_NAME}/cache
41
 
42
  # CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
43
  CMD ["python", "app.py"]
 
1
  # FROM nvidia/cuda:11.1.1-devel-ubuntu20.04
2
  FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
3
 
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
 
7
  ENV CUDA_HOME=/usr/local/cuda
8
+ ENV PATH=${CUDA_HOME}/bin:/home/user/.local/bin:${PATH}
9
  ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
10
  ENV LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_PATH}
11
+ ENV TORCH_EXTENSIONS_DIR=/home/user/.cache
12
+
13
+ WORKDIR /home/user
14
 
15
  # apt install by root user
16
  RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
 
33
  # RUN pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
34
  RUN pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
35
 
36
+ COPY --chown=user . /home/user
 
37
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
38
 
39
  RUN wget https://www.dropbox.com/scl/fi/105qy7mkqfjcmnfd3tmv0/edit.pth?rlkey=qcd67cdrqz4jra0p3er966iuk -O clevr.pth
 
40
 
 
 
41
 
42
  # CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
43
  CMD ["python", "app.py"]