fix(docker): 优化Playwright浏览器依赖安装流程
- 切换回root用户安装Playwright及其系统依赖 - 确保Playwright浏览器安装带有必要依赖 - 安装完成后切换回非root用户执行后续操作 - 保持镜像标签信息不变
This commit is contained in:
@@ -67,10 +67,16 @@ RUN if [ "$USE_PROXY" = "1" ]; then \
|
||||
uv sync --frozen --no-dev --no-install-project; \
|
||||
fi
|
||||
|
||||
# Install Playwright browsers with dependencies
|
||||
# Switch back to root user to install Playwright system dependencies
|
||||
USER root
|
||||
|
||||
# Install Playwright browsers with dependencies (requires root)
|
||||
RUN .venv/bin/playwright install chromium --with-deps && \
|
||||
.venv/bin/playwright install-deps chromium
|
||||
|
||||
# Switch back to non-root user
|
||||
USER appuser
|
||||
|
||||
# Label the image
|
||||
LABEL maintainer="kami-spider-team" \
|
||||
version="1.0.0" \
|
||||
|
||||
Reference in New Issue
Block a user