Spaces:
Sleeping
Sleeping
File size: 508 Bytes
2d1fa8d aecca3a 2d1fa8d aecca3a 2d1fa8d aecca3a 2d1fa8d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
FROM python:3.10-slim
# Create a user
RUN useradd -m -u 1000 user
USER user
# Set working directory
WORKDIR /app
# Copy requirements and install globally
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade --break-system-packages -r requirements.txt
# Copy all files
COPY . .
# Set environment variable for FastAPI port
ENV PORT=7860
# Ensure uvicorn is in PATH
ENV PATH="/home/user/.local/bin:$PATH"
# Run the FastAPI app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |