# Use a lightweight Python image FROM python:3.10-slim # Set the working directory inside the cloud server WORKDIR /app # Install 'unzip' utility on the Linux server RUN apt-get update && apt-get install -y unzip # Copy the requirements file and install COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all your backend files (including model.zip) COPY . . # Unzip the model and remove the zip file to save space! RUN unzip model.zip -d ./ && rm model.zip # Hugging Face Spaces require port 7860 EXPOSE 7860 # The command to start your FastAPI server CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]