Spaces:
Sleeping
Sleeping
File size: 830 Bytes
084bcc6 a8e2416 8b4c51d a8e2416 8b4c51d a8e2416 8b4c51d a8e2416 60e69f7 a8e2416 8b4c51d b6f95b7 a8e2416 |
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 |
#finalversion
# Use an official, lightweight Python image
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /code
# Copy the requirements file first to leverage Docker's build cache
COPY ./requirements.txt /code/requirements.txt
# Install all Python dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy the rest of your application code into a subdirectory
COPY ./app /code/app
# --- FIX 1: Set the working directory to where your app code is ---
WORKDIR /code/app
# --- FIX 2: CRITICAL - Expose the port your app runs on ---
# This tells Hugging Face where to send traffic.
EXPOSE 7860
# Define the command to run your application
# This now correctly runs from inside the /code/app directory
CMD ["uvicorn", "main_api:app", "--host", "0.0.0.0", "--port", "7860"] |