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