-
Notifications
You must be signed in to change notification settings - Fork 57
/
Dockerfile
42 lines (31 loc) · 1.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# Install system dependencies needed for Playwright
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
# Add Poetry to PATH
ENV PATH="/root/.local/bin:$PATH"
# Set the working directory
WORKDIR /app
# Copy the poetry files and install dependencies
COPY pyproject.toml poetry.lock* /app/
RUN poetry install --no-root
# Install Playwright and the required browser binaries with dependencies
RUN poetry run playwright install --with-deps firefox
# Copy the rest of the application code
COPY . /app/
# Set the PYTHONPATH to the app directory
ENV PYTHONPATH=/app
ENV URL=https://parsera.org
ENV FILE=/app/scheme.json
ENV OUTPUT=/app/output/result.json
# Expose the output folder (where the result will be saved)
VOLUME /app/output
ENTRYPOINT ["poetry", "run", "python", "-m", "parsera.main"]