banao-tech commited on
Commit
43bbc25
·
verified ·
1 Parent(s): f4193b9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -1,24 +1,24 @@
1
- # Step 1: Use an appropriate base image
2
  FROM python:3.10
3
 
4
- # Step 2: Switch to root user
5
  USER root
6
 
7
- # Step 3: Install necessary dependencies
8
  RUN chmod 1777 /tmp \
9
  && apt update -q && apt install -y ca-certificates wget libgl1 \
10
  && wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
11
  && dpkg -i /tmp/cuda-keyring.deb && apt update -q \
12
  && apt install -y --no-install-recommends libcudnn8 libcublas-12-2
13
 
14
- # Step 4: Install FastAPI and other Python dependencies
15
- RUN pip install fastapi[all] uvicorn
16
 
17
- # Step 5: Copy application code
18
  COPY main.py main.py
19
 
20
- # Step 6: Run Python script to check for errors before starting FastAPI
21
  RUN python main.py
22
 
23
- # Step 7: Start FastAPI server
24
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use an appropriate base image (you can adjust this as per your requirements)
2
  FROM python:3.10
3
 
4
+ # Switch to root user
5
  USER root
6
 
7
+ # Install system dependencies
8
  RUN chmod 1777 /tmp \
9
  && apt update -q && apt install -y ca-certificates wget libgl1 \
10
  && wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
11
  && dpkg -i /tmp/cuda-keyring.deb && apt update -q \
12
  && apt install -y --no-install-recommends libcudnn8 libcublas-12-2
13
 
14
+ # Install Python dependencies
15
+ RUN pip install fastapi[all] uvicorn Pillow
16
 
17
+ # Copy the application code
18
  COPY main.py main.py
19
 
20
+ # Run Python script to check for errors before starting FastAPI
21
  RUN python main.py
22
 
23
+ # Start FastAPI server
24
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]