File size: 671 Bytes
a96bcc0 8d4bae4 8cc1d57 a96bcc0 8cc1d57 a96bcc0 3c85b91 8cc1d57 a96bcc0 60a24bb |
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 |
# Use a small Python base image
FROM python:3.10
RUN useradd -m -u 1000 user
USER user
# Fast, clean installs
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PORT=7860
WORKDIR /app
# Copy your app
COPY ./requirements.txt /app/requirements.txt
# Install Python deps
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
RUN getent passwd user || useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:${PATH}"
COPY --chown=user . /app
# Expose the port Hugging Face expects
EXPOSE 7860
# Run your app (it will read $PORT below)
CMD ["gunicorn", "-k", "eventlet", "-w", "1", "-b", "0.0.0.0:7860", "app:app"] |