Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +14 -9
Dockerfile
CHANGED
@@ -1,21 +1,26 @@
|
|
1 |
# Use official Python image as base
|
2 |
-
FROM python:3.
|
3 |
|
4 |
-
# Set the working directory
|
5 |
WORKDIR /app
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
# Copy the requirements file
|
8 |
COPY requirements.txt .
|
9 |
|
10 |
-
# Install dependencies
|
11 |
-
RUN
|
12 |
-
&& pip install --no-cache-dir -r requirements.txt
|
13 |
|
14 |
-
# Copy the application
|
15 |
COPY . .
|
16 |
|
17 |
-
# Expose the
|
18 |
EXPOSE 7860
|
19 |
|
20 |
-
# Run
|
21 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"
|
|
|
1 |
# Use official Python image as base
|
2 |
+
FROM python:3.9-slim
|
3 |
|
4 |
+
# Set the working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Install system dependencies for OpenCV and other libraries
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
libgl1-mesa-glx \
|
10 |
+
libglib2.0-0 \
|
11 |
+
&& rm -rf /var/lib/apt/lists/*
|
12 |
+
|
13 |
# Copy the requirements file
|
14 |
COPY requirements.txt .
|
15 |
|
16 |
+
# Install Python dependencies
|
17 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
18 |
|
19 |
+
# Copy the model and application files
|
20 |
COPY . .
|
21 |
|
22 |
+
# Expose the FastAPI port (7860 for Hugging Face)
|
23 |
EXPOSE 7860
|
24 |
|
25 |
+
# Run FastAPI with Uvicorn
|
26 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|