banao-tech commited on
Commit
e2579dc
Β·
verified Β·
1 Parent(s): dd38931

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -11
Dockerfile CHANGED
@@ -1,23 +1,25 @@
1
- # Base image with CUDA support for PyTorch
2
- FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
 
 
 
 
 
 
 
 
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy application code
8
  COPY . /app
9
 
10
- # Install system dependencies
11
- RUN apt-get update && apt-get install -y \
12
- python3-pip \
13
- libgl1-mesa-glx \
14
- && apt-get clean
15
-
16
  # Install Python dependencies
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Expose port 7860
20
  EXPOSE 7860
21
 
22
- # Run FastAPI app with uvicorn on port 7860
23
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Base image
2
+ FROM python:3.10-slim
3
+
4
+ # Install system dependencies for OpenCV
5
+ RUN apt-get update && apt-get install -y \
6
+ libglib2.0-0 \
7
+ libsm6 \
8
+ libxrender1 \
9
+ libxext6 \
10
+ && rm -rf /var/lib/apt/lists/*
11
 
12
  # Set working directory
13
  WORKDIR /app
14
 
15
+ # Copy files into container
16
  COPY . /app
17
 
 
 
 
 
 
 
18
  # Install Python dependencies
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Expose the port used by the application
22
  EXPOSE 7860
23
 
24
+ # Start the FastAPI server
25
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]