Spaces:
Running
Running
Commit
·
b1f386d
1
Parent(s):
932e485
docker
Browse files- .dockerignore +9 -0
- Dockerfile +25 -0
.dockerignore
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__pycache__/
|
2 |
+
*.pyc
|
3 |
+
*.pyo
|
4 |
+
*.pyd
|
5 |
+
.Python
|
6 |
+
env/
|
7 |
+
venv/
|
8 |
+
.git/
|
9 |
+
*.egg-info/
|
Dockerfile
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 1. Use a slim Python image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# 2. Install OS-level deps (including setuptools) that PaddleOCR and OpenCV need
|
5 |
+
RUN apt-get update && \
|
6 |
+
apt-get install -y --no-install-recommends \
|
7 |
+
build-essential \
|
8 |
+
libglib2.0-0 libsm6 libxrender1 libxext6 \
|
9 |
+
python3-setuptools \
|
10 |
+
&& rm -rf /var/lib/apt/lists/*
|
11 |
+
|
12 |
+
WORKDIR /app
|
13 |
+
|
14 |
+
# 3. Copy & install Python deps without pip cache
|
15 |
+
COPY requirements.txt .
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
+
|
18 |
+
# 4. Copy your whole app
|
19 |
+
COPY . .
|
20 |
+
|
21 |
+
# 5. Tell the container to listen on $PORT
|
22 |
+
ENV PORT 8080
|
23 |
+
|
24 |
+
# 6. Start via Gunicorn
|
25 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
|