Spaces:
Paused
Paused
File size: 868 Bytes
95e7952 b0f4609 95e7952 b0f4609 72cdf46 95e7952 72cdf46 72c9558 72cdf46 b0f4609 95e7952 b0f4609 95e7952 b0f4609 95e7952 b0f4609 95e7952 b0f4609 95e7952 | 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 31 32 33 34 35 | # Use an official Python runtime as a parent image
FROM python:3.10-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PORT=7860
# Set the working directory in the container
WORKDIR /app
# Install system dependencies required for OpenCV and scientific Python libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libgl1 \
libglib2.0-0 \
libxcb1 \
libhdf5-dev \
libnetcdf-dev \
&& 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 rest of the application code
COPY . .
# Expose the port Hugging Face Spaces expects
EXPOSE 7860
# Command to run the FastAPI application
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]
|