-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 861 Bytes
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 861 Bytes
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
FROM python:3.9-slim
WORKDIR /app
# Install system dependencies required for Playwright
RUN apt-get update && apt-get install -y \
chromium \
fonts-ipafont-gothic \
fonts-wqy-zenhei \
fonts-thai-tlwg \
fonts-kacst \
fonts-freefont-ttf \
libxss1 \
&& rm -rf /var/lib/apt/lists/*
# Set environment variable to use Chromium
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Run Crawl4AI setup
RUN crawl4ai-setup
# Copy application code
COPY main.py .
COPY crawler.py .
# Create directory for crawl results
RUN mkdir -p /app/crawl_results
# Expose the port the app runs on
EXPOSE 8001
# Command to run the application
CMD ["python", "main.py"]