Recommendation_Deploy / Dockerfile
USF00's picture
Initial deployment setup for Recommendation_Deploy
4b5c25d
raw
history blame contribute delete
593 Bytes
FROM python:3.9-slim
ENV HF_HOME=/tmp/huggingface
ENV PYTHONUNBUFFERED=1
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Copy requirements and install
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY --chown=user . .
# Expose port 7860 for Hugging Face Spaces
EXPOSE 7860
# Run uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]