Spaces:
Running
Running
srivatsavdamaraju
commited on
Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.8-slim
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the current directory contents into the container at /app
|
8 |
+
COPY . /app
|
9 |
+
|
10 |
+
# Install system dependencies
|
11 |
+
RUN apt-get update && \
|
12 |
+
apt-get install -y \
|
13 |
+
python3-opencv \
|
14 |
+
libglib2.0-0 \
|
15 |
+
libsm6 \
|
16 |
+
libxext6 \
|
17 |
+
libxrender-dev \
|
18 |
+
&& rm -rf /var/lib/apt/lists/*
|
19 |
+
|
20 |
+
# Install dependencies from requirements.txt
|
21 |
+
RUN pip install --upgrade pip
|
22 |
+
RUN pip install -r requirements.txt
|
23 |
+
|
24 |
+
# Expose port 7860 for Hugging Face Spaces (default port for web apps)
|
25 |
+
EXPOSE 7860
|
26 |
+
|
27 |
+
# Command to run the application using Gunicorn with multiple threads
|
28 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--threads", "4", "app:app"]
|