rates/backend/Dockerfile
jtricerolph 3c4bc633fe Revert to headed Chrome + Xvfb; add shm_size 256m to fix Xvfb in Docker
Headless mode gets blocked by Cloudflare on the search endpoint. Headed
mode with Xvfb works on dev (Unraid). The missing piece on Proxmox LXC was
insufficient /dev/shm (Docker default 64 MB); setting shm_size: 256m gives
Xvfb enough shared memory to start.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-09 17:36:27 +00:00

25 lines
531 B
Docker

FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
postgresql-client \
curl \
xvfb \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Playwright + Chromium for Booking.com scraper
RUN playwright install chromium --with-deps
COPY . .
EXPOSE 8000
ENV DISPLAY=:99
CMD ["sh", "-c", "Xvfb :99 -screen 0 1280x720x24 -nolisten tcp & sleep 1 && uvicorn main:app --host 0.0.0.0 --port 8000"]