|
|
|
FROM python:3.9-slim |
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE 1 |
|
ENV PYTHONUNBUFFERED 1 |
|
|
|
|
|
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 |
|
ENV PATH="/home/user/.local/bin:$PATH" |
|
ENV HF_HOME="/app/.cache/huggingface" |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
libgl1-mesa-glx \ |
|
libgomp1 \ |
|
libglib2.0-0 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY requirements.txt /app/ |
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
|
|
|
RUN mkdir -p /app/flask_sessions /app/uploads && chmod -R 777 /app/flask_sessions /app/uploads |
|
|
|
|
|
COPY . /app/ |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
ENV FLASK_APP=app.py |
|
ENV FLASK_ENV=production |
|
|
|
|
|
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:7860", "--timeout", "120", "app:app"] |