File size: 670 Bytes
d382ddb
 
41e802f
 
 
d382ddb
 
 
 
 
 
 
23a3391
d382ddb
 
 
 
41e802f
 
 
d382ddb
 
8b5a84c
 
d382ddb
 
41e802f
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
FROM zenika/alpine-chrome:with-playwright

# Switch to root user to install packages
USER root

WORKDIR /app

# Install Python and pip
RUN apk add --no-cache python3 py3-pip

# Copy requirements first for better caching
COPY requirements.txt .
RUN python3 -m pip install --no-cache-dir --break-system-packages -r requirements.txt

# Copy your code
COPY . .

# Switch back to chrome user for security
USER chrome

# FastAPI and Uvicorn are already installed via requirements.txt
# Playwright browsers are already available in the base image

EXPOSE 7860

# Run the FastAPI application
CMD ["python3", "-m", "uvicorn", "scrape:app", "--host", "0.0.0.0", "--port", "7860"]