shubham5524 commited on
Commit
0219b19
·
verified ·
1 Parent(s): 1738002

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -20
Dockerfile CHANGED
@@ -1,28 +1,28 @@
1
- # Use a minimal Python base image
2
- FROM python:3.10-slim
3
 
4
- # Set the working directory
5
- WORKDIR /app
6
-
7
- # Copy all files to the container
8
- COPY . /app
9
 
10
- # Install system dependencies (for some Python packages like numpy, pandas, etc.)
11
  RUN apt-get update && apt-get install -y \
12
- build-essential \
 
 
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Upgrade pip and install Python dependencies
16
- RUN pip install --upgrade pip && \
17
- pip install -r requirements.txt
 
 
18
 
19
- # Create writable cache/config directories (if needed by your app)
20
- RUN mkdir -p /app/cache/matplotlib && \
21
- mkdir -p /app/cache/torchxrayvision && \
22
- chmod -R 777 /app/cache
23
 
24
- # Expose a port if your app runs on one (optional, usually 8000 for FastAPI/Uvicorn)
25
- EXPOSE 8000
26
 
27
- # Default command (adjust if your main file is different or uses gunicorn, etc.)
28
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # Use the full Python image, not slim
2
+ FROM python:3.10
3
 
4
+ # Set environment variables
5
+ ENV DEBIAN_FRONTEND=noninteractive
 
 
 
6
 
7
+ # Install OpenCV dependencies
8
  RUN apt-get update && apt-get install -y \
9
+ libgl1 \
10
+ libglib2.0-0 \
11
+ ffmpeg \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Create app directory
15
+ WORKDIR /app
16
+
17
+ # Copy all files
18
+ COPY . /app
19
 
20
+ # Install Python dependencies
21
+ RUN pip install --upgrade pip
22
+ RUN pip install -r requirements.txt
 
23
 
24
+ # Expose port (optional but good practice)
25
+ EXPOSE 7860
26
 
27
+ # Run the app (adjust according to your main file)
28
+ CMD ["python", "app.py"]