Spaces:
Runtime error
Runtime error
File size: 742 Bytes
2a1dfcb a77298f a48622f e076f1e 2a1dfcb a48622f 2a1dfcb dc6eaab | 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 27 28 29 30 | # Use the official Python 3.11 slim image
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# Install system dependencies required for OpenCV
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the requirements file into the container
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire FastAPI app into the container
COPY . .
# Expose the port that FastAPI will use (default is 8000)
EXPOSE 8000
# Set an environment variable for the port
ENV PORT=8000
# Command to run the application
CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port $PORT"]
|