Maulidaaa commited on
Commit
54b9f12
·
verified ·
1 Parent(s): 5155301

Upload 4 files

Browse files
Files changed (4) hide show
  1. Dockerfile +30 -0
  2. main.py +6 -0
  3. passenger_wsgi.py +7 -0
  4. requirements.txt +58 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ RUN apt-get update && apt-get install -y \
4
+ tesseract-ocr \
5
+ libgl1 \
6
+ libglib2.0-0 \
7
+ && apt-get clean
8
+
9
+ # Install required system packages
10
+ RUN apt-get update && apt-get install -y libgl1 libglib2.0-0
11
+
12
+ # Create a non-root user and switch to it
13
+ RUN useradd -m -u 1000 user
14
+ USER user
15
+
16
+ # Ensure correct PATH for installed Python and local binaries
17
+ ENV PATH="/usr/local/bin:/home/user/.local/bin:$PATH"
18
+
19
+ # Set working directory
20
+ WORKDIR /app
21
+
22
+ # Copy and install dependencies
23
+ COPY --chown=user ./requirements.txt requirements.txt
24
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
25
+
26
+ # Copy the rest of the app
27
+ COPY --chown=user . /app
28
+
29
+ # Run the app
30
+ CMD ["/usr/local/bin/python", "main.py"]
main.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ from app import create_app
2
+
3
+ app = create_app()
4
+
5
+ if __name__ == "__main__":
6
+ app.run(debug=True, host="0.0.0.0", port=7860)
passenger_wsgi.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import sys
2
+ import os
3
+
4
+ # Tambahkan direktori project ke sys.path
5
+ sys.path.insert(0, os.path.dirname(__file__))
6
+
7
+ from main import main as application
requirements.txt ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fastapi
2
+ uvicorn[standard]
3
+ blinker==1.9.0
4
+ certifi==2025.1.31
5
+ charset-normalizer==3.4.1
6
+ click==8.1.8
7
+ colorama==0.4.6
8
+ easyocr==1.7.2
9
+ filelock==3.18.0
10
+ Flask==3.1.0
11
+ fsspec==2025.3.2
12
+ huggingface-hub==0.30.2
13
+ idna==3.10
14
+ imageio==2.37.0
15
+ importlib_metadata==8.6.1
16
+ itsdangerous==2.2.0
17
+ Jinja2==3.1.6
18
+ joblib==1.4.2
19
+ lazy_loader==0.4
20
+ MarkupSafe==3.0.2
21
+ mpmath==1.3.0
22
+ networkx==3.2.1
23
+ ninja==1.11.1.4
24
+ numpy==2.0.2
25
+ opencv-contrib-python==4.11.0.86
26
+ opencv-python-headless==4.11.0.86
27
+ packaging==24.2
28
+ pandas==2.2.3
29
+ pillow==11.1.0
30
+ pyclipper==1.3.0.post6
31
+ pyngrok==7.2.3
32
+ pytesseract==0.3.13
33
+ python-bidi==0.6.6
34
+ python-dateutil==2.9.0.post0
35
+ pytz==2025.2
36
+ PyYAML==6.0.2
37
+ regex==2024.11.6
38
+ requests==2.32.3
39
+ safetensors==0.5.3
40
+ scikit-image==0.24.0
41
+ scikit-learn==1.6.1
42
+ scipy==1.13.1
43
+ sentence-transformers==4.0.2
44
+ shapely==2.0.7
45
+ six==1.17.0
46
+ sympy==1.13.1
47
+ threadpoolctl==3.6.0
48
+ tifffile==2024.8.30
49
+ tokenizers==0.21.1
50
+ torch==2.6.0
51
+ torchvision==0.21.0
52
+ tqdm==4.67.1
53
+ transformers==4.51.1
54
+ typing_extensions==4.13.1
55
+ tzdata==2025.2
56
+ urllib3==2.3.0
57
+ Werkzeug==3.1.3
58
+ zipp==3.21.0