SpiceyToad commited on
Commit
2fa269c
·
verified ·
1 Parent(s): c6e26f4

Upload Dockerfile

Browse files

Add debugging to Dockerfile

Files changed (1) hide show
  1. Dockerfile +12 -1
Dockerfile CHANGED
@@ -1,10 +1,12 @@
 
1
  FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime
2
 
3
  # Create a new user with user ID 1000
4
  RUN useradd -m -u 1000 user
5
 
6
- # Set environment variables for cache
7
  ENV HF_HOME=/home/user/cache
 
8
 
9
  # Switch to the new user
10
  USER user
@@ -19,8 +21,17 @@ COPY --chown=user . /home/user/app
19
  # Install Python dependencies, including uvicorn
20
  RUN pip install --no-cache-dir -r requirements.txt uvicorn
21
 
 
 
 
 
 
22
  # Expose the application port
23
  EXPOSE 7860
24
 
 
 
 
 
25
  # Run the application
26
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use the PyTorch image as the base
2
  FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime
3
 
4
  # Create a new user with user ID 1000
5
  RUN useradd -m -u 1000 user
6
 
7
+ # Set environment variables
8
  ENV HF_HOME=/home/user/cache
9
+ ENV PATH="/home/user/.local/bin:$PATH"
10
 
11
  # Switch to the new user
12
  USER user
 
21
  # Install Python dependencies, including uvicorn
22
  RUN pip install --no-cache-dir -r requirements.txt uvicorn
23
 
24
+ # Debugging: Check if uvicorn is installed and print its location
25
+ RUN which uvicorn || echo "uvicorn is not installed!"
26
+ RUN pip show uvicorn || echo "uvicorn package details not found!"
27
+ RUN echo $PATH
28
+
29
  # Expose the application port
30
  EXPOSE 7860
31
 
32
+ # Debugging: Print Python version and installed packages
33
+ RUN python --version
34
+ RUN pip list
35
+
36
  # Run the application
37
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]