File size: 853 Bytes
77d2ae2 56afbd6 baabedc 56afbd6 1c58854 56afbd6 baabedc 1c58854 56afbd6 1c58854 fb59ea2 5485b94 1c58854 | 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 | FROM python:3.12-slim
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
pandoc \
&& rm -rf /var/lib/apt/lists/*
# Create and switch to user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
ENV PYTHONPATH=/app
ENV GUNICORN_CMD_ARGS="--timeout 600 --keep-alive 60"
# Set up working directory
WORKDIR /app
# Clone the repository (instead of COPY)
RUN git clone https://github.com/mfoud444/research.git /app
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir --upgrade -r requirements.txt && \
pip install --no-cache-dir --upgrade g4f[all]
# Expose port
EXPOSE 7860
# Run the application
CMD ["gunicorn", "--workers", "3", "--bind", "0.0.0.0:7860", "--worker-class", "gevent", "app:app"] |