Karim shoair commited on
Commit
9620812
·
1 Parent(s): 4a670f6

feat: Add docker support

Browse files
Files changed (2) hide show
  1. .dockerignore +110 -0
  2. Dockerfile +37 -0
.dockerignore ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Github
2
+ .github/
3
+
4
+ # docs
5
+ docs/
6
+ images/
7
+ .cache/
8
+ .claude/
9
+
10
+ # cached files
11
+ __pycache__/
12
+ *.py[cod]
13
+ .cache
14
+ .DS_Store
15
+ *~
16
+ .*.sw[po]
17
+ .build
18
+ .ve
19
+ .env
20
+ .pytest
21
+ .benchmarks
22
+ .bootstrap
23
+ .appveyor.token
24
+ *.bak
25
+ *.db
26
+ *.db-*
27
+
28
+ # installation package
29
+ *.egg-info/
30
+ dist/
31
+ build/
32
+
33
+ # environments
34
+ .venv
35
+ env/
36
+ venv/
37
+ ENV/
38
+ env.bak/
39
+ venv.bak/
40
+
41
+ # C extensions
42
+ *.so
43
+
44
+ # pycharm
45
+ .idea/
46
+
47
+ # vscode
48
+ *.code-workspace
49
+
50
+ # Packages
51
+ *.egg
52
+ *.egg-info
53
+ dist
54
+ build
55
+ eggs
56
+ .eggs
57
+ parts
58
+ bin
59
+ var
60
+ sdist
61
+ wheelhouse
62
+ develop-eggs
63
+ .installed.cfg
64
+ lib
65
+ lib64
66
+ venv*/
67
+ .venv*/
68
+ pyvenv*/
69
+ pip-wheel-metadata/
70
+ poetry.lock
71
+
72
+ # Installer logs
73
+ pip-log.txt
74
+
75
+ # mypy
76
+ .mypy_cache/
77
+ .dmypy.json
78
+ dmypy.json
79
+ mypy.ini
80
+
81
+ # test caches
82
+ .tox/
83
+ .pytest_cache/
84
+ .coverage
85
+ htmlcov
86
+ report.xml
87
+ nosetests.xml
88
+ coverage.xml
89
+
90
+ # Translations
91
+ *.mo
92
+
93
+ # Buildout
94
+ .mr.developer.cfg
95
+
96
+ # IDE project files
97
+ .project
98
+ .pydevproject
99
+ .idea
100
+ *.iml
101
+ *.komodoproject
102
+
103
+ # Complexity
104
+ output/*.html
105
+ output/*/index.html
106
+
107
+ # Sphinx
108
+ docs/_build
109
+ public/
110
+ web/
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim-trixie AS builder
2
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
3
+
4
+ # Set environment variables
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+ ENV PYTHONUNBUFFERED=1
7
+ ENV PYTHONDONTWRITEBYTECODE=1
8
+
9
+ ADD . /app
10
+
11
+ WORKDIR /app
12
+
13
+ # Install dependencies
14
+ RUN --mount=type=cache,target=/root/.cache/uv \
15
+ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
16
+ uv sync --no-install-project --all-extras --compile-bytecode
17
+
18
+ # Install all browsers and their deps
19
+ RUN uv run playwright install-deps chromium firefox
20
+ RUN uv run playwright install chromium
21
+ RUN uv run camoufox fetch --browserforge
22
+
23
+ # Sync the project
24
+ RUN --mount=type=cache,target=/root/.cache/uv \
25
+ uv sync --all-extras --compile-bytecode
26
+
27
+ # Clean up to save space
28
+ RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
29
+
30
+ # Expose port for MCP server HTTP transport
31
+ EXPOSE 8000
32
+
33
+ # Set entrypoint to run scrapling
34
+ ENTRYPOINT ["uv", "run", "scrapling"]
35
+
36
+ # Default command (can be overridden)
37
+ CMD ["--help"]