Update Dockerfile

This commit is contained in:
fanyinrumeng 2024-12-04 21:46:26 +08:00 committed by GitHub
parent 748b8be9ef
commit ade9797675
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,16 +37,34 @@ EXPOSE 8080
WORKDIR /app/zhenxun WORKDIR /app/zhenxun
# 安装运行时所需的系统依赖
RUN apt update && \ RUN apt update && \
apt install -y --no-install-recommends \ apt install -y --no-install-recommends \
libgl1-mesa-glx \ libgl1-mesa-glx \
libglib2.0-0 \ libglib2.0-0 \
libnss3 \
libnspr4 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libasound2 \
libpango-1.0-0 \
libcairo2 \
&& apt clean && \ && apt clean && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# 复制依赖项和应用代码 # 复制依赖项和应用代码
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=builder /app/zhenxun /app/zhenxun COPY --from=builder /app/zhenxun /app/zhenxun
# 复制 Playwright 浏览器
COPY --from=builder /root/.cache/ms-playwright /root/.cache/ms-playwright
# 设置数据和资源目录 # 设置数据和资源目录
VOLUME /app/zhenxun/data /app/zhenxun/resources /app/zhenxun/.env.dev VOLUME /app/zhenxun/data /app/zhenxun/resources /app/zhenxun/.env.dev