Files

62 lines
1.8 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# NapCat-Docker 镜像构建文件
# 依据 39 服现存镜像的 docker history 还原(构建 commit: 60dc2d72126890a0ae88a36f64000c08b7b8bf7a)
# 原仓库 https://github.com/NapNeko/NapCat-Docker 已 404 删除
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive \
TZ=Asia/Shanghai
RUN apt-get update && apt-get install -y \
libnss3 \
libnotify4 \
libsecret-1-0 \
libgbm1 \
xvfb \
libasound2 \
fonts-wqy-zenhei \
gnutls-bin \
libglib2.0-dev \
libdbus-1-3 \
libgtk-3-0 \
libxss1 \
libxtst6 \
libatspi2.0-0 \
libx11-xcb1 \
ffmpeg \
unzip \
dbus-user-session \
curl \
jq \
gosu \
tzdata && \
echo "${TZ}" > /etc/timezone && \
ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN useradd --no-log-init -d /app napcat
WORKDIR /app
COPY NapCat.Shell.zip entrypoint.sh /app/
COPY templates/ /app/templates/
# 安装 Linux QQ(版本与原始镜像一致)
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
curl --retry 3 --connect-timeout 30 --max-time 600 -fL -o linuxqq.deb \
"https://qqdl.gtimg.cn/qqfile/QQNT/9.9.36/beta/9ee04bef/linuxqq_3.2.34-53644_${arch}.deb" && \
dpkg -i --force-depends linuxqq.deb && \
rm linuxqq.deb
# 注入 NapCat 加载脚本
RUN chmod +x entrypoint.sh && \
echo "(async () => {await import('file:///app/napcat/napcat.mjs');})();" > /opt/QQ/resources/app/loadNapCat.js && \
sed -i 's|"main": "[^"]*"|"main": "./loadNapCat.js"|' /opt/QQ/resources/app/package.json
VOLUME [/app/.config/QQ]
VOLUME [/app/napcat/config]
ENTRYPOINT ["bash", "entrypoint.sh"]