BuildBrowser / Dockerfile
StarrySkyWorld's picture
Create Dockerfile
535520f verified
raw
history blame
752 Bytes
FROM python:3.11-slim
# 设置工作目录
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y \
wget \
gnupg \
libnss3 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libasound2 \
libpango-1.0-0 \
libcairo2 \
libatspi2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# 安装Python依赖
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 安装Playwright浏览器
RUN playwright install chromium
# 复制应用文件
COPY main.py .
COPY config.json .
COPY cookies.json* ./
# 暴露端口
EXPOSE 8000
# 启动应用
CMD ["python", "main.py"]