Eloquence-Backend / Dockerfile
PMS61
fixes
fbd0a6b
raw
history blame
836 Bytes
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /code
# Set environment variables for caching
ENV PYTHONPATH="/code"
ENV HF_HOME="/code/.cache"
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ffmpeg \
libsm6 \
libxext6 \
&& rm -rf /var/lib/apt/lists/*
# Copy and install Python dependencies
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt gunicorn gevent
# Copy the application code
COPY . /code/
# Expose the port
EXPOSE 7860
# Run the application
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "4", "--worker-class", "gevent", "--timeout", "600", "app:app"]