Spaces:
Sleeping
Sleeping
dekh le bro
Browse files12345678910111213141516# Dockerfile# Use a lightweight official Python imageFROM python:3.11-slim# Set the working directory inside the containerWORKDIR /code# Copy the requirements file and install all dependenciesCOPY ./requirements.txt /code/requirements.txtRUN pip install --no-cache-dir --upgrade -r /code/requirements.txt# Copy all your application files (backend_app.py, best.pt) into the containerCOPY . /code/# The command that tells the server how to run your FastAPI appCMD ["uvicorn", "backend_app:app", "--host", "0.0.0.0", "--port", "7860"]1234567891011121314151617181920# Dockerfile for the Backend API# 1. Start with a modern, lightweight Python version.FROM python:3.11-slim# 2. Set the working directory inside the container.WORKDIR /code# 3. FIX: Update package lists and install the missing graphics library for OpenCV.RUN apt-get update && apt-get install -y libgl1-mesa-glx# 4. Copy the requirements file and install Python dependencies.COPY ./requirements.txt /code/requirements.txtRUN pip install --no-cache-dir --upgrade -r /code/requirements.txt# 5. Copy all your application files (backend_app.py, best.pt) into the container.COPY . /code/# 6. The command that tells the server how to run your FastAPI app.CMD ["uvicorn", "backend_app:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+10-6