Newer
Older
cortex-hub / browser-service / Dockerfile
FROM mcr.microsoft.com/playwright/python:v1.42.0-jammy

WORKDIR /app

# Install gRPC and dependencies
RUN pip install --no-cache-dir grpcio grpcio-tools playwright playwright-stealth beautifulsoup4

# Copy only the necessary files
COPY main.py .
COPY src/ ./src/
COPY protos/ ./protos/

# Generate gRPC stubs
RUN python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. protos/browser.proto

# Initialize Playwright
RUN playwright install chromium

EXPOSE 50052

CMD ["python3", "main.py"]