# Use an official lightweight Python image FROM python:3.10-slim # Hugging Face Spaces require the app to run as user '1000' RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" # Set the working directory inside the container WORKDIR /app # Copy all your local files into the container COPY --chown=user . /app # Install all your Python packages RUN pip install --no-cache-dir -r requirements.txt # Expose port 7860 EXPOSE 7860 # BYPASS run.sh and run everything directly in the Docker CMD # This prevents the Windows/Linux invisible character crash CMD ["bash", "-c", "uvicorn api.main:app --host 127.0.0.1 --port 8000 & sleep 10 && streamlit run frontend/app.py --server.port 7860 --server.address 0.0.0.0"]