# Use a lightweight Python base image FROM python:3.11-slim # Set up a working directory WORKDIR /code # Copy dependencies first to utilize Docker layer caching RUN pip install --no-cache-dir "fastapi[standard]" edge-tts uvicorn # Copy the application code COPY main.py . # Expose the specific port Hugging Face requires EXPOSE 7860 # Run the API server CMD ["python", "main.py"]