# Use an official Python runtime as a base image | |
FROM python:3.11-slim | |
# Set environment variables | |
ENV PYTHONUNBUFFERED=1 | |
# Create and set the working directory | |
WORKDIR /app | |
# Copy the requirements.txt file into the container at /app | |
COPY requirements.txt /app/ | |
# Install any needed dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the current directory contents into the container at /app | |
COPY . /app/ | |
# Expose the port FastAPI will run on | |
EXPOSE 7860 | |
# Run the application using uvicorn | |
CMD ["python", "app.py"] | |