sreepathi-ravikumar commited on
Commit
43b0693
·
verified ·
1 Parent(s): 0d4b107

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -20
Dockerfile CHANGED
@@ -1,35 +1,33 @@
 
1
  FROM python:3.9-slim
2
 
 
3
  WORKDIR /app
4
- # After setting WORKDIR /app
5
- RUN mkdir -p /app/images && chmod -R 777 /app/images
6
 
7
- # Install system dependencies
8
  RUN apt-get update && \
9
- apt-get install -y --no-install-recommends \
10
- gcc \
11
- ffmpeg \
12
- libsm6 \
13
- libxext6 \
14
- curl \
15
- libjpeg-dev \
16
- zlib1g-dev \
17
- && rm -rf /var/lib/apt/lists/*
18
-
19
- # Install Python dependencies
20
  COPY requirements.txt .
21
- RUN python -m pip install --no-cache-dir -r requirements.txt && \
22
- python -m pip list
23
 
24
- # Copy application files
25
  COPY app.py text2generation.py audio_scripter.py image_scripter.py image_fetcher.py video_creater.py ./
26
 
27
- # Expose port
 
 
 
28
  EXPOSE 7860
29
 
30
- # Health check
31
  HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
32
  CMD curl -f http://localhost:7860/health || exit 1
33
 
34
- # Run app
35
  CMD ["python", "app.py"]
 
1
+ # Use a minimal Python image
2
  FROM python:3.9-slim
3
 
4
+ # Set working directory
5
  WORKDIR /app
 
 
6
 
7
+ # Install required system packages
8
  RUN apt-get update && \
9
+ apt-get install -y --no-install-recommends gcc ffmpeg curl && \
10
+ rm -rf /var/lib/apt/lists/*
11
+
12
+ # Upgrade pip
13
+ RUN python -m pip install --upgrade pip
14
+
15
+ # Copy requirements and install Python dependencies
 
 
 
 
16
  COPY requirements.txt .
17
+ RUN python -m pip install --no-cache-dir -r requirements.txt
 
18
 
19
+ # Copy application code
20
  COPY app.py text2generation.py audio_scripter.py image_scripter.py image_fetcher.py video_creater.py ./
21
 
22
+ # Create necessary directories with correct permissions
23
+ RUN mkdir -p /app/images && chmod -R 755 /app/images
24
+
25
+ # Expose the port your app runs on
26
  EXPOSE 7860
27
 
28
+ # Add health check
29
  HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
30
  CMD curl -f http://localhost:7860/health || exit 1
31
 
32
+ # Start the application
33
  CMD ["python", "app.py"]