feat: Add docker support
This commit is contained in:
+110
@@ -0,0 +1,110 @@
|
||||
# Github
|
||||
.github/
|
||||
|
||||
# docs
|
||||
docs/
|
||||
images/
|
||||
.cache/
|
||||
.claude/
|
||||
|
||||
# cached files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
.cache
|
||||
.DS_Store
|
||||
*~
|
||||
.*.sw[po]
|
||||
.build
|
||||
.ve
|
||||
.env
|
||||
.pytest
|
||||
.benchmarks
|
||||
.bootstrap
|
||||
.appveyor.token
|
||||
*.bak
|
||||
*.db
|
||||
*.db-*
|
||||
|
||||
# installation package
|
||||
*.egg-info/
|
||||
dist/
|
||||
build/
|
||||
|
||||
# environments
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# pycharm
|
||||
.idea/
|
||||
|
||||
# vscode
|
||||
*.code-workspace
|
||||
|
||||
# Packages
|
||||
*.egg
|
||||
*.egg-info
|
||||
dist
|
||||
build
|
||||
eggs
|
||||
.eggs
|
||||
parts
|
||||
bin
|
||||
var
|
||||
sdist
|
||||
wheelhouse
|
||||
develop-eggs
|
||||
.installed.cfg
|
||||
lib
|
||||
lib64
|
||||
venv*/
|
||||
.venv*/
|
||||
pyvenv*/
|
||||
pip-wheel-metadata/
|
||||
poetry.lock
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
mypy.ini
|
||||
|
||||
# test caches
|
||||
.tox/
|
||||
.pytest_cache/
|
||||
.coverage
|
||||
htmlcov
|
||||
report.xml
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
|
||||
# Buildout
|
||||
.mr.developer.cfg
|
||||
|
||||
# IDE project files
|
||||
.project
|
||||
.pydevproject
|
||||
.idea
|
||||
*.iml
|
||||
*.komodoproject
|
||||
|
||||
# Complexity
|
||||
output/*.html
|
||||
output/*/index.html
|
||||
|
||||
# Sphinx
|
||||
docs/_build
|
||||
public/
|
||||
web/
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
FROM python:3.12-slim-trixie AS builder
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||
|
||||
# Set environment variables
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
ADD . /app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
||||
uv sync --no-install-project --all-extras --compile-bytecode
|
||||
|
||||
# Install all browsers and their deps
|
||||
RUN uv run playwright install-deps chromium firefox
|
||||
RUN uv run playwright install chromium
|
||||
RUN uv run camoufox fetch --browserforge
|
||||
|
||||
# Sync the project
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --all-extras --compile-bytecode
|
||||
|
||||
# Clean up to save space
|
||||
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Expose port for MCP server HTTP transport
|
||||
EXPOSE 8000
|
||||
|
||||
# Set entrypoint to run scrapling
|
||||
ENTRYPOINT ["uv", "run", "scrapling"]
|
||||
|
||||
# Default command (can be overridden)
|
||||
CMD ["--help"]
|
||||
Reference in New Issue
Block a user