Huzaifa367 commited on
Commit
58bc21e
·
verified ·
1 Parent(s): 2d5cfed

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -17
Dockerfile CHANGED
@@ -1,30 +1,30 @@
1
- # Use the official Python image as the base image
2
  FROM python:3.9-slim
3
 
4
- # Set environment variables for Python
5
  ENV PYTHONDONTWRITEBYTECODE 1
6
  ENV PYTHONUNBUFFERED 1
7
 
8
- # Install system dependencies
9
- RUN apt-get update \
10
- && apt-get install -y --no-install-recommends \
11
- wget \
12
- unzip \
13
- && apt-get clean \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Install necessary Python packages
17
- RUN pip install --upgrade pip
18
- RUN pip install gradio transformers huggingface_hub
19
-
20
- # Set working directory in the container
21
  WORKDIR /app
22
 
23
- # Copy the Python script and model files into the container
24
- COPY app.py /app/
 
 
 
 
 
 
25
 
26
- # Expose port 7860 (default port for Gradio interface)
27
  EXPOSE 7860
28
 
29
- # Command to run the Python script with uvicorn when the container starts
30
  CMD ["python", "app.py"]
 
1
+ # Use official Python image
2
  FROM python:3.9-slim
3
 
4
+ # Set environment variables
5
  ENV PYTHONDONTWRITEBYTECODE 1
6
  ENV PYTHONUNBUFFERED 1
7
 
8
+ # Install system dependencies (if needed)
9
+ RUN apt-get update && apt-get install -y \
10
+ wget \
11
+ unzip \
 
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Set working directory
 
 
 
 
15
  WORKDIR /app
16
 
17
+ # Copy requirements file
18
+ COPY requirements.txt .
19
+
20
+ # Install Python dependencies
21
+ RUN pip install --use-deprecated=legacy-resolver -r requirements.txt
22
+
23
+ # Copy application files
24
+ COPY . /app
25
 
26
+ # Expose necessary ports
27
  EXPOSE 7860
28
 
29
+ # Command to run the application
30
  CMD ["python", "app.py"]