unknown commited on
Commit
508c8f2
·
1 Parent(s): c68a5f0

fix dep req.txt optimize image size

Browse files
Files changed (3) hide show
  1. .dockerignore +15 -4
  2. Dockerfile +8 -7
  3. requirements.txt +0 -5
.dockerignore CHANGED
@@ -1,8 +1,19 @@
1
  __pycache__
2
  *.pyc
3
- .git
4
- .env
5
- venv
 
 
6
  .venv
7
- node_modules
 
 
 
 
 
 
 
 
 
8
  .cache
 
1
  __pycache__
2
  *.pyc
3
+ *.pyo
4
+ *.pyd
5
+ .Python
6
+ env/
7
+ venv/
8
  .venv
9
+ .env
10
+ .git
11
+ .gitignore
12
+ .vscode
13
+ .idea
14
+ docker_data/
15
+ output/
16
+ *.pdf
17
+ *.jpg
18
+ *.png
19
  .cache
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.11-slim
2
 
3
- WORKDIR /home/user/app
4
 
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  wget gnupg ca-certificates \
@@ -16,14 +16,15 @@ RUN pip install --no-cache-dir playwright && \
16
  PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright playwright install chromium --with-deps && \
17
  rm -rf /var/lib/apt/lists/*
18
 
19
- COPY . .
20
-
21
- RUN chmod -R 755 /home/user
22
-
23
- EXPOSE 7860
24
  ENV PORT=7860
25
  ENV PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright
26
-
27
  ENV HF_HOME=/home/user/.cache/huggingface
 
 
 
 
 
 
 
28
 
29
  CMD ["python", "-m", "hypercorn", "server:app", "-b", "0.0.0.0:7860", "--access-log", "-", "--error-log", "-", "--log-level", "info"]
 
1
  FROM python:3.11-slim
2
 
3
+ WORKDIR /home/user
4
 
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  wget gnupg ca-certificates \
 
16
  PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright playwright install chromium --with-deps && \
17
  rm -rf /var/lib/apt/lists/*
18
 
 
 
 
 
 
19
  ENV PORT=7860
20
  ENV PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright
 
21
  ENV HF_HOME=/home/user/.cache/huggingface
22
+ RUN chmod -R 755 /home/user
23
+
24
+ RUN python -c "from transformers import AutoModelForImageSegmentation; AutoModelForImageSegmentation.from_pretrained('briaai/RMBG-1.4', trust_remote_code=True)"
25
+
26
+ COPY . .
27
+
28
+ EXPOSE 7860
29
 
30
  CMD ["python", "-m", "hypercorn", "server:app", "-b", "0.0.0.0:7860", "--access-log", "-", "--error-log", "-", "--log-level", "info"]
requirements.txt CHANGED
@@ -1,16 +1,12 @@
1
  python-dotenv
2
  requests
3
  playwright
4
- asyncio
5
- dotenv
6
- Flask
7
  playwright-stealth
8
  hypercorn
9
  google-genai
10
  beautifulsoup4
11
  pymupdf
12
  flask[async]
13
- pandas
14
  fpdf
15
  pandas
16
 
@@ -23,5 +19,4 @@ numpy
23
  opencv-python-headless
24
  pillow
25
  transformers
26
- huggingface_hub
27
  accelerate
 
1
  python-dotenv
2
  requests
3
  playwright
 
 
 
4
  playwright-stealth
5
  hypercorn
6
  google-genai
7
  beautifulsoup4
8
  pymupdf
9
  flask[async]
 
10
  fpdf
11
  pandas
12
 
 
19
  opencv-python-headless
20
  pillow
21
  transformers
 
22
  accelerate