Prathamesh1420 commited on
Commit
c229b61
·
verified ·
1 Parent(s): a7ef023

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -28
Dockerfile CHANGED
@@ -1,37 +1,24 @@
1
- # Use an official Python base image
2
- FROM python:3.9-slim
3
 
4
- # Set environment variables
5
- ENV TRANSFORMERS_CACHE=/app/cache
6
- ENV PYTHONUNBUFFERED=1
7
 
8
- # Create application directories
9
  WORKDIR /app
10
- RUN mkdir -p /app/cache /app/app
11
-
12
- # Copy requirements file into the container
13
- COPY requirements.txt /app/
14
 
15
- # Install system dependencies (optional: add others if needed)
16
- RUN apt-get update && apt-get install -y \
17
- wget \
18
- && rm -rf /var/lib/apt/lists/*
19
 
20
- # Install Python dependencies
21
- RUN pip install --upgrade pip
22
- RUN pip install -r /app/requirements.txt
23
 
24
- # Install PyTorch (for CPU, change to GPU version if required)
25
- RUN pip install torch torchvision
26
 
27
- # Optional: Install TensorFlow if you're using it
28
- # RUN pip install tensorflow
29
-
30
- # Copy application code into the container
31
- COPY . /app/app
32
-
33
- # Expose the port Gradio will use
34
  EXPOSE 7860
35
 
36
- # Run the Gradio app
37
- CMD ["python", "/app/app/app.py"]
 
 
 
1
+ # Dockerfile
 
2
 
3
+ # Use the official Python image with the desired version
4
+ FROM python:3.9-slim
 
5
 
6
+ # Set the working directory inside the container
7
  WORKDIR /app
 
 
 
 
8
 
9
+ # Copy the requirements file to the working directory
10
+ COPY requirements.txt /app
 
 
11
 
12
+ # Install the dependencies
13
+ RUN pip install --no-cache-dir -r requirements.txt
 
14
 
15
+ # Copy the rest of the application code to the working directory
16
+ COPY app.py /app
17
 
18
+ # Expose the port that Gradio will run on (default is 7860)
 
 
 
 
 
 
19
  EXPOSE 7860
20
 
21
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
22
+
23
+ # Command to run your application
24
+ CMD ["python", "app.py"]