test / Dockerfile
Rajkhanke008's picture
Create Dockerfile
e822ab5 verified
Raw
History Blame Contribute Delete
444 Bytes
FROM python:3.10-slim
# 1. Create a user (HF requires UID 1000)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /home/user/app
# 2. Install dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 3. Copy app code
COPY --chown=user . .
# 4. Run with 1 worker (to save memory) on port 7860
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--workers", "1", "app:app"]