|
|
|
FROM ubuntu:22.04 |
|
|
|
|
|
WORKDIR /z |
|
|
|
|
|
ENV TZ=Asia/Shanghai |
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
SHELL ["/bin/bash", "-c"] |
|
|
|
|
|
RUN apt-get update -q && apt-get install -y -qq \ |
|
git curl wget tzdata \ |
|
libglib2.0-0 libnss3 libnspr4 libdbus-1-3 libxcomposite1 \ |
|
libxdamage1 libxrandr2 libgtk-3-0 libasound2 libxtst6 \ |
|
libxshmfence1 libxcb1 redis-server gnupg ca-certificates nodejs \ |
|
python3.10 python3-pip \ |
|
fonts-noto fonts-noto-cjk fonts-wqy-zenhei fonts-wqy-microhei \ |
|
fonts-dejavu-core fonts-freefont-ttf fonts-ipafont-mincho fonts-ipafont-gothic > /dev/null |
|
|
|
|
|
RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg && \ |
|
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list && \ |
|
apt-get update -q && apt-get install -y -q google-chrome-stable && \ |
|
apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN git clone --quiet --branch create-pr/update_version https://github.com/HibiKier/zhenxun_bot.git |
|
WORKDIR /zmal/zhenxun_bot |
|
|
|
ENV PLAYWRIGHT_BROWSERS_PATH=/zmal/.cache/ms-playwright |
|
RUN mkdir -p /zmal/.cache/ms-playwright && \ |
|
PIP_ROOT_USER_ACTION=ignore pip install -q poetry playwright && \ |
|
playwright install chromium --with-deps > /dev/null |
|
|
|
|
|
|
|
RUN poetry config virtualenvs.in-project true && \ |
|
poetry install --quiet&&poetry update --quiet |
|
|
|
COPY .env.dev /zmal/zhenxun_bot/.env.dev |
|
|
|
RUN --mount=type=secret,id=zzz,mode=0444,required=true \ |
|
sed -i "s|^DB_URL =.*|DB_URL = \"$(cat /run/secrets/zzz)\"|" /zmal/zhenxun_bot/.env.dev |
|
|
|
EXPOSE 6221 |
|
COPY config.yaml /zmal/zhenxun_bot/data/config.yaml |
|
RUN chmod -R 777 /zmal/ |
|
CMD poetry run python bot.py |
|
|