sreepathi-ravikumar commited on
Commit
0cdfe68
·
verified ·
1 Parent(s): 3a09363

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -5
Dockerfile CHANGED
@@ -2,18 +2,25 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install required system packages
6
  RUN apt-get update && \
7
- apt-get install -y curl && \
8
- rm -rf /var/lib/apt/lists/*
 
9
 
10
- # Copy and install dependencies
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
- # Copy application files
15
  COPY app.py audio_generator.py ./
16
 
 
 
 
17
  EXPOSE 7860
18
 
 
 
 
19
  CMD ["python", "app.py"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && \
7
+ apt-get install -y --no-install-recommends \
8
+ ffmpeg \
9
+ && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Copy requirements first for caching
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Application code
16
  COPY app.py audio_generator.py ./
17
 
18
+ # Environment variables
19
+ ENV PYTHONUNBUFFERED=1
20
+
21
  EXPOSE 7860
22
 
23
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
24
+ CMD curl -f http://localhost:7860/health || exit 1
25
+
26
  CMD ["python", "app.py"]