Spaces:
Sleeping
Sleeping
File size: 589 Bytes
c27eaf1 9995142 c27eaf1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install dependencies
COPY backend/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY backend/ ./backend/
COPY frontend/ ./frontend/
RUN mkdir -p ./data
# HF Spaces runs as user with uid 1000
RUN useradd -m -u 1000 user
RUN mkdir -p /app/data && chown -R user:user /app
USER user
# HF Spaces expects port 7860
EXPOSE 7860
# Run the FastAPI app from the backend directory
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--app-dir", "backend"]
|