# Use the official Python image. Adjust the version if needed. FROM python:3.10-slim # Set the working directory in the container WORKDIR /code # Copy just the requirements file first to leverage Docker cache COPY ./requirements.txt /code/requirements.txt # Install dependencies # --no-cache-dir can reduce image size, --upgrade pip is good practice RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code into the container # This includes app.py and your asd_classifier_model.pkl file COPY . /code/ # Expose the port FastAPI will run on (Hugging Face default is 7860) EXPOSE 7860 # Command to run the application using uvicorn # Ensure 'app:app' matches your filename (app.py) and FastAPI instance ('app') # Use 0.0.0.0 to listen on all network interfaces, port 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]