# Use the official Python image as a base | |
FROM python:3.10 | |
# Set the working directory | |
WORKDIR /app | |
# Install the required packages | |
RUN pip install tensorflow fastapi uvicorn requests pillow python-multipart | |
# Copy the FastAPI application code into the container | |
COPY . . | |
# Expose the required port for FastAPI (you may choose any available port, e.g., 7860 for compatibility with Hugging Face Spaces) | |
EXPOSE 7860 | |
# Run the FastAPI application with uvicorn | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |