Spaces:
Sleeping
Sleeping
File size: 1,008 Bytes
c3576fc d7977d4 b974791 55f66b9 43b0693 b974791 43b0693 b974791 196d1af b974791 40d5b36 43b0693 c3576fc 7f12dea b974791 7f12dea 2a352d7 b974791 703c9f8 b974791 d7977d4 b974791 196d1af |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
FROM python:3.11-slim
WORKDIR /app
# Install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc ffmpeg curl && \
rm -rf /var/lib/apt/lists/*
# Install pip before using it (fixes pip: not found error)
RUN python -m ensurepip --upgrade && pip install --no-cache-dir --upgrade pip
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create necessary folders with correct permissions
RUN mkdir -p /app/images /app/videos && chmod -R 777 /app/images /app/videos
# Copy application code
COPY app.py text2generation.py audio_scripter.py image_scripter.py image_fetcher.py video.py ./
RUN apt-get update && apt-get install -y ffmpeg
RUN apt-get update && apt-get install -y fonts-liberation
# Expose the Flask port
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
# Start the app
CMD ["python", "app.py"] |