Update Dockerfile
Browse files- Dockerfile +21 -20
Dockerfile
CHANGED
|
@@ -1,21 +1,22 @@
|
|
| 1 |
-
# Use an official Python runtime
|
| 2 |
-
FROM python:3.9
|
| 3 |
-
|
| 4 |
-
# Set working directory
|
| 5 |
-
WORKDIR /code
|
| 6 |
-
|
| 7 |
-
# Install system dependencies for OpenCV and MediaPipe
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
| 21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use an official Python runtime
|
| 2 |
+
FROM python:3.9
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /code
|
| 6 |
+
|
| 7 |
+
# Install system dependencies for OpenCV and MediaPipe
|
| 8 |
+
# We replaced 'libgl1-mesa-glx' with 'libgl1' to fix the build error
|
| 9 |
+
RUN apt-get update && apt-get install -y \
|
| 10 |
+
libgl1 \
|
| 11 |
+
libglib2.0-0 \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
# Copy requirements and install
|
| 15 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 16 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 17 |
+
|
| 18 |
+
# Copy the rest of the application
|
| 19 |
+
COPY . .
|
| 20 |
+
|
| 21 |
+
# Command to run the application (Hugging Face uses port 7860)
|
| 22 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|