File size: 683 Bytes
f5a62f1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# Use a lightweight Python base image
FROM python:3.9-slim
# Set the working directory inside the container
WORKDIR /code
# Copy the requirements file first to leverage Docker layer caching
COPY ./requirements.txt /code/requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy the entire 'app' directory into the container
COPY ./app /code/app
# Expose the port the app will run on (Hugging Face Spaces default)
EXPOSE 7860
# Command to run the application using uvicorn
# --host 0.0.0.0 makes the server accessible from outside the container
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |