Spaces:
Running
Running
FROM python:3.10-slim | |
# Install wget and git for HF Space requirements | |
RUN apt-get update && apt-get install -y \ | |
wget \ | |
git \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Create a user with home directory for git config | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
WORKDIR /app | |
# Copy and install requirements | |
COPY --chown=user requirements.txt . | |
RUN pip install --no-cache-dir --upgrade pip | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy application code | |
COPY --chown=user main.py . | |
EXPOSE 7860 | |
# Start the application | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |