File size: 927 Bytes
ec591aa
 
 
 
 
 
 
a9cce6e
ec591aa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
# 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"]