Spaces:
Sleeping
Sleeping
File size: 1,215 Bytes
934712a 4b24639 |
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 |
# Use Playwright python image (Chromium + deps preinstalled)
FROM mcr.microsoft.com/playwright/python:v1.44.0-jammy
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Fix SSL/TLS issues
ENV PYTHONHTTPSVERIFY=0
ENV SSL_VERIFY=false
ENV REQUESTS_CA_BUNDLE=""
ENV CURL_CA_BUNDLE=""
# Update certificates and install network tools
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
wget \
openssl \
&& update-ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage caching
COPY requirements.txt /app/requirements.txt
# Install Python dependencies with SSL fixes
RUN pip install --no-cache-dir --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt
# Install Playwright browser with dependencies
RUN python -m playwright install --with-deps chromium
# Run Crawl4AI setup
RUN crawl4ai-setup
# Run Crawl4AI doctor (diagnostics)
RUN crawl4ai-doctor || true
# Copy rest of application
COPY . /app
# Make start script executable
RUN chmod +x /app/start.sh
# Use non-root user that Playwright image provides
USER pwuser
# Start backend with gunicorn
CMD ["python", "app.py"] |