YashVardhan-coder
Initial clean deploy
b8c035c
Raw
History Blame Contribute Delete
673 Bytes
FROM python:3.12-slim
# System setup and user configuration for Hugging Face Spaces (UID 1000)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Copy requirements first to leverage Docker layer caching
COPY --chown=user requirements.txt $HOME/app/requirements.txt
RUN pip install --no-cache-dir --user -r requirements.txt
# Copy all application code
COPY --chown=user . $HOME/app
# Ensure correct permissions for rules database writing
RUN chmod -R 777 $HOME/app
# Expose port 7860 (Hugging Face default) and run the FastAPI app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]