# Use the official Unsloth image which has all training deps pre-installed FROM unsloth/unsloth:latest USER root WORKDIR /app # Install dependencies using the requirements.txt file COPY requirements.txt . RUN /opt/venv/bin/pip install --no-cache-dir -r requirements.txt # Copy the project files COPY . . # Set environment variables ENV PYTHONPATH="/app" ENV GRADIO_ANALYTICS_ENABLED=False # Disable vLLM to avoid Gemma3Config import errors in the Space ENV UNSLOTH_USE_VLLM=0 # Expose the default Gradio/FastAPI port EXPOSE 7860 # Ensure we override the base image's entrypoint (which starts supervisord) ENTRYPOINT [] # Start the FastAPI server (which mounts the Gradio demo at /demo) CMD ["/opt/venv/bin/python", "-m", "uvicorn", "server.main:app", "--host", "0.0.0.0", "--port", "7860"]