ThomasBlumet commited on
Commit
65f5aea
·
1 Parent(s): 1e59ffd

change base img to cuda

Browse files
Files changed (1) hide show
  1. Dockerfile +51 -2
Dockerfile CHANGED
@@ -1,5 +1,8 @@
1
  # For more information, please refer to https://aka.ms/vscode-docker-python
2
- FROM python:3.10-slim
 
 
 
3
 
4
  # Where we'll copy the code
5
  WORKDIR /code
@@ -8,6 +11,7 @@ WORKDIR /code
8
  COPY ./requirements.txt /code/requirements.txt
9
  # Install pip requirements
10
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
11
 
12
  # Creates a non-root user with an explicit UID
13
  # For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
@@ -30,4 +34,49 @@ COPY --chown=user . $HOME/app
30
  # Expose port 7860
31
  EXPOSE 7860
32
  ENV GRADIO_SERVER_NAME="0.0.0.0"
33
- CMD ["python", "app.py"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # For more information, please refer to https://aka.ms/vscode-docker-python
2
+ #FROM python:3.10-slim
3
+ FROM nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04
4
+
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
 
7
  # Where we'll copy the code
8
  WORKDIR /code
 
11
  COPY ./requirements.txt /code/requirements.txt
12
  # Install pip requirements
13
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
14
+ RUN pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
15
 
16
  # Creates a non-root user with an explicit UID
17
  # For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
 
34
  # Expose port 7860
35
  EXPOSE 7860
36
  ENV GRADIO_SERVER_NAME="0.0.0.0"
37
+ CMD ["python", "app.py"]
38
+
39
+ ##################################################
40
+ #with cuda 12.1
41
+ # FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
42
+
43
+ # ARG DEBIAN_FRONTEND=noninteractive
44
+
45
+ # ENV PYTHONUNBUFFERED=1
46
+
47
+ # RUN apt-get update && apt-get install --no-install-recommends -y \
48
+ # build-essential \
49
+ # python3.9 \
50
+ # python3-pip \
51
+ # git \
52
+ # ffmpeg \
53
+ # && apt-get clean && rm -rf /var/lib/apt/lists/*
54
+
55
+ # WORKDIR /code
56
+
57
+ # COPY ./requirements.txt /code/requirements.txt
58
+
59
+ # # Set up a new user named "user" with user ID 1000
60
+ # RUN useradd -m -u 1000 user
61
+ # # Switch to the "user" user
62
+ # USER user
63
+ # # Set home to the user's home directory
64
+ # ENV HOME=/home/user \
65
+ # PATH=/home/user/.local/bin:$PATH \
66
+ # PYTHONPATH=$HOME/app \
67
+ # PYTHONUNBUFFERED=1 \
68
+ # GRADIO_ALLOW_FLAGGING=never \
69
+ # GRADIO_NUM_PORTS=1 \
70
+ # GRADIO_SERVER_NAME=0.0.0.0 \
71
+ # GRADIO_THEME=huggingface \
72
+ # SYSTEM=spaces
73
+
74
+ # RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
75
+
76
+ # # Set the working directory to the user's home directory
77
+ # WORKDIR $HOME/app
78
+
79
+ # # Copy the current directory contents into the container at $HOME/app setting the owner to the user
80
+ # COPY --chown=user . $HOME/app
81
+
82
+ # CMD ["python3", "app.py"]