-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
88 lines (73 loc) · 2.04 KB
/
Copy pathDockerfile
File metadata and controls
88 lines (73 loc) · 2.04 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Use Python 3.11 slim image as base
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
# Install system dependencies for multi-browser support
RUN apt-get update && apt-get install -y \
# Playwright dependencies
libnss3 \
libnspr4 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libasound2 \
# Selenium dependencies
wget \
gnupg2 \
software-properties-common \
# Tesseract OCR
tesseract-ocr \
tesseract-ocr-eng \
# Firefox for Selenium fallback
firefox-esr \
&& rm -rf /var/lib/apt/lists/*
# Install Chromium and ChromeDriver (better ARM64 support)
RUN apt-get update && apt-get install -y \
chromium \
chromium-driver \
&& rm -rf /var/lib/apt/lists/*
# Set environment variables for browser binaries
ENV CHROME_BIN=/usr/bin/chromium
ENV CHROMEDRIVER_PATH=/usr/bin/chromedriver
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Install additional dependencies for our enhanced version
RUN pip install --no-cache-dir \
streamlit \
bcrypt \
pyyaml \
python-docx \
fastapi \
uvicorn
# Install Playwright browsers (all supported browsers)
RUN playwright install chromium firefox webkit
RUN playwright install-deps
# Copy the rest of the application
COPY . .
# Ensure config directory and files are present
RUN ls -la /app/config/ || echo "Config directory not found"
# Create necessary directories
RUN mkdir -p logs reports
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
# Expose port for Streamlit
EXPOSE 8501
# Command to run the application
CMD ["streamlit", "run", "main.py", "--server.port=8501", "--server.address=0.0.0.0"]