# MCP Browser Sidecar Dockerfile
# Based on Playwright's official Python image with Chromium pre-installed
FROM mcr.microsoft.com/playwright/python:v1.56.0-jammy
WORKDIR /app
# Copy requirements first for layer caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY app/ ./app/
# Create screenshots directory
RUN mkdir -p /screenshots && chmod 777 /screenshots
# Expose port
EXPOSE 8931
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8931/health || exit 1
# Run the server
CMD ["uvicorn", "app.server:app", "--host", "0.0.0.0", "--port", "8931"]