Spaces:
Paused
Paused
FROM python:3.10-slim | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
bash \ | |
wget \ | |
git \ | |
git-lfs \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Set up user properly | |
RUN useradd -m -u 1000 user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
# Set working directory in user's home | |
WORKDIR $HOME/app | |
# Copy requirements and install as user | |
COPY --chown=user requirements.txt . | |
USER user | |
RUN pip install --no-cache-dir --upgrade pip && \ | |
pip install --no-cache-dir -r requirements.txt | |
# Copy application code | |
COPY --chown=user . $HOME/app | |
# Make sure port matches the one in your code | |
EXPOSE 8001 | |
# Use uvicorn directly with specific settings | |
CMD ["uvicorn", "main.app:app", "--host", "0.0.0.0", "--port", "8001", "--workers", "1", "--reload", "false"] |