Spaces:
Runtime error
Runtime error
banao-tech
commited on
Update Dockerfile
Browse files- Dockerfile +13 -11
Dockerfile
CHANGED
@@ -1,23 +1,25 @@
|
|
1 |
-
# Base image
|
2 |
-
FROM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Copy
|
8 |
COPY . /app
|
9 |
|
10 |
-
# Install system dependencies
|
11 |
-
RUN apt-get update && apt-get install -y \
|
12 |
-
python3-pip \
|
13 |
-
libgl1-mesa-glx \
|
14 |
-
&& apt-get clean
|
15 |
-
|
16 |
# Install Python dependencies
|
17 |
RUN pip install --no-cache-dir -r requirements.txt
|
18 |
|
19 |
-
# Expose port
|
20 |
EXPOSE 7860
|
21 |
|
22 |
-
#
|
23 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Base image
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Install system dependencies for OpenCV
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
libglib2.0-0 \
|
7 |
+
libsm6 \
|
8 |
+
libxrender1 \
|
9 |
+
libxext6 \
|
10 |
+
&& rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
# Set working directory
|
13 |
WORKDIR /app
|
14 |
|
15 |
+
# Copy files into container
|
16 |
COPY . /app
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
# Install Python dependencies
|
19 |
RUN pip install --no-cache-dir -r requirements.txt
|
20 |
|
21 |
+
# Expose the port used by the application
|
22 |
EXPOSE 7860
|
23 |
|
24 |
+
# Start the FastAPI server
|
25 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|