AutoPage / Dockerfile
Mqleet's picture
[update] docker
6e45633
raw
history blame
1.3 kB
FROM python:3.10
# 切换到 root 用户以安装系统依赖
USER root
# 更新apt包列表并安装缺失的libGL库和其他相关依赖
# RUN apt-get update && apt-get install -y libgl1-mesa-glx
# 很多时候,只安装 libgl1-mesa-glx 就够了,但有时 opencv 还需要其他库,下面这个更全
# 更新 apt 包列表,并安装构建工具和正确的运行时依赖
# 注意:已将 libgl1-mesa-glx 替换为 libgl1
# RUN apt-get update && apt-get install -y \
# build-essential \
# libgl1 \
# libglib2.0-0 \
# && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
build-essential \
libgl1 \
libglib2.0-0 \
libnss3 libnspr4 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libxkbcommon0 libasound2 libatspi2.0-0 \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user requirements.txt /app/
RUN pip install -r requirements.txt
RUN pip install gradio
RUN playwright install chromium
COPY --chown=user . /app
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
# CMD ["uvicorn", "app:demo", "--host", "0.0.0.0", "--port", "7860"]
CMD ["python", "app.py"]