ayloll commited on
Commit
ae93310
·
verified ·
1 Parent(s): 99efd65

Update dockerfile.dockerfile

Browse files
Files changed (1) hide show
  1. dockerfile.dockerfile +8 -13
dockerfile.dockerfile CHANGED
@@ -1,7 +1,5 @@
1
- # Use official Python image
2
  FROM python:3.9-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
  # Install system dependencies
@@ -10,24 +8,21 @@ RUN apt-get update && \
10
  ffmpeg \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Copy requirements first to leverage Docker cache
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy application files (excluding cookies.txt in normal build)
18
  COPY . .
19
 
20
- # Create a mount point for cookies (better security than baking into image)
21
- VOLUME /app/cookies
 
22
 
23
- # Environment variable for cookies path
24
- ENV COOKIES_PATH=/app/cookies/cookies.txt
 
25
 
26
- # Download Whisper model during build (optional)
27
- # RUN python -c "import whisper; whisper.load_model('base')"
28
-
29
- # Expose port
30
  EXPOSE 7860
31
 
32
- # Run the application
33
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.9-slim
2
 
 
3
  WORKDIR /app
4
 
5
  # Install system dependencies
 
8
  ffmpeg \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Install Python dependencies
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Copy application
16
  COPY . .
17
 
18
+ # Environment variables
19
+ ENV GRADIO_SERVER_NAME=0.0.0.0
20
+ ENV GRADIO_SERVER_PORT=7860
21
 
22
+ # Health check
23
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
24
+ CMD curl -f http://localhost:7860 || exit 1
25
 
 
 
 
 
26
  EXPOSE 7860
27
 
 
28
  CMD ["python", "app.py"]