dockerize
This commit is contained in:
parent
1e0f302178
commit
56c203189f
2 changed files with 45 additions and 0 deletions
1
crawler/.dockerignore
Normal file
1
crawler/.dockerignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
data
|
||||
44
crawler/Dockerfile
Normal file
44
crawler/Dockerfile
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
FROM python:3.13-slim
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
build-essential \
|
||||
gcc \
|
||||
python3-dev \
|
||||
libopencv-dev \
|
||||
libgl1 \
|
||||
libglib2.0-0 \
|
||||
tesseract-ocr \
|
||||
tesseract-ocr-eng \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Poetry
|
||||
ENV POETRY_HOME=/opt/poetry \
|
||||
POETRY_VIRTUALENVS_IN_PROJECT=true \
|
||||
POETRY_NO_INTERACTION=1
|
||||
|
||||
RUN curl -sSL https://install.python-poetry.org | python3 - && \
|
||||
cd /usr/local/bin && \
|
||||
ln -s /opt/poetry/bin/poetry && \
|
||||
poetry --version
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy only the files needed for dependency installation
|
||||
COPY pyproject.toml poetry.lock ./
|
||||
|
||||
# Install dependencies
|
||||
RUN poetry install --only main --no-root
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
# Copy the application code
|
||||
COPY . .
|
||||
|
||||
# Make the CLI executable
|
||||
RUN chmod +x /app/main.py
|
||||
|
||||
# Set the entry point (adjust to your CLI's entry point)
|
||||
# ENTRYPOINT ["python", "/app/main.py"]
|
||||
ENTRYPOINT ["/app/runall.sh"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue