backendprocessfast2 / Dockerfile
sreepathi-ravikumar's picture
Create Dockerfile
84308e2 verified
raw
history blame
788 Bytes
FROM python:3.9-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc \
python3-dev \
ffmpeg \
libimage-exiftool-perl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Application code
COPY app.py text2generation.py video_processor.py ./
# Environment variables
ENV TRANSFORMERS_CACHE=/tmp/cache \
HF_HOME=/tmp/cache \
PYTHONUNBUFFERED=1
# Create cache directory
RUN mkdir -p /tmp/cache && \
chmod 777 /tmp/cache
EXPOSE 7860
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
CMD ["python", "app.py"]