CoolFace
Apppublic

t430/t

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
Dockerfile135 linesDownload Raw Back to root
1FROM node:20-slim as nodebuilder2 3FROM python:3.11-slim-bullseye as builder4ARG QL_MAINTAINER="whyour"5LABEL maintainer="${QL_MAINTAINER}"6ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git7ARG QL_BRANCH=debian8 9ENV QL_DIR=/ql \10  QL_BRANCH=${QL_BRANCH}11 12COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/13COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/14RUN set -x && \15  ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \16  apt-get update && \17  apt-get install --no-install-recommends -y libatomic1 git && \18  git config --global user.email "qinglong@@users.noreply.github.com" && \19  git config --global user.name "qinglong" && \20  git config --global http.postBuffer 524288000 && \21  git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} 22 23RUN mkdir /tmp/build24RUN cp ${QL_DIR}/package.json ${QL_DIR}/.npmrc ${QL_DIR}/pnpm-lock.yaml /tmp/build/25 26RUN npm i -g pnpm@8.3.1 && \27  cd /tmp/build && \28  pnpm install --prod29 30FROM python:3.11-slim-bullseye31 32ARG QL_MAINTAINER="whyour"33LABEL maintainer="${QL_MAINTAINER}"34ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git35ARG QL_BRANCH=debian36 37ENV PNPM_HOME=/root/.local/share/pnpm \38  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/share/pnpm:/root/.local/share/pnpm/global/5/node_modules:$PNPM_HOME \39  NODE_PATH=/usr/local/bin:/usr/local/pnpm-global/5/node_modules:/usr/local/lib/node_modules:/root/.local/share/pnpm/global/5/node_modules \40  LANG=C.UTF-8 \41  SHELL=/bin/bash \42  PS1="\u@\h:\w \$ " \43  QL_DIR=/ql \44  QL_BRANCH=${QL_BRANCH}45 46COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/47COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/48 49RUN set -x && \50  ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \51  ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \52  apt-get update && \53  apt-get upgrade -y && \54  apt-get install --no-install-recommends -y git \55  curl \56  cron \57  wget \58  tzdata \59  perl \60  openssl \61  openssh-client \62  nginx \63  jq \64  procps \65  netcat \66  sshpass \67  rclone \68  unzip \69  libatomic1 && \70  apt-get clean && \71  ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \72  echo "Asia/Shanghai" >/etc/timezone && \73  git config --global user.email "qinglong@@users.noreply.github.com" && \74  git config --global user.name "qinglong" && \75  git config --global http.postBuffer 524288000 && \76  npm install -g pnpm@8.3.1 pm2 ts-node && \77  rm -rf /root/.pnpm-store && \78  rm -rf /root/.local/share/pnpm/store && \79  rm -rf /root/.cache && \80  rm -rf /root/.npm && \81  chmod u+s /usr/sbin/cron && \82  ulimit -c 083 84ARG SOURCE_COMMIT85RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} && \86  cd ${QL_DIR} && \87  cp -f .env.example .env && \88  chmod 777 ${QL_DIR}/shell/*.sh && \89  chmod 777 ${QL_DIR}/docker/*.sh && \90  git clone --depth=1 -b ${QL_BRANCH} https://github.com/${QL_MAINTAINER}/qinglong-static.git /static && \91  mkdir -p ${QL_DIR}/static && \92  cp -rf /static/* ${QL_DIR}/static && \93  rm -rf /static && \94  rm -f ${QL_DIR}/docker/docker-entrypoint.sh95 96COPY docker-entrypoint.sh ${QL_DIR}/docker97 98RUN mkdir /ql/data && \99  mkdir /ql/data/config && \100  mkdir /ql/data/log && \101  mkdir /ql/data/db && \102  mkdir /ql/data/scripts && \103  mkdir /ql/data/repo && \104  mkdir /ql/data/raw && \105  mkdir /ql/data/deps && \106  chmod -R 777 /ql && \107  chmod -R 777 /var && \108  chmod -R 777 /usr/local && \109  chmod -R 777 /etc/nginx && \110  chmod -R 777 /run && \111  chmod -R 777 /usr && \112  chmod -R 777 /root 113 114COPY --from=builder /tmp/build/node_modules/. /ql/node_modules/115 116WORKDIR ${QL_DIR}117 118 119# Set up a new user named "user" with user ID 1000120RUN useradd -m -u 1000 user121 122# Switch to the "user" user123USER user124 125# 创建rclone配置文件126RUN rclone config -h127 128HEALTHCHECK --interval=5s --timeout=2s --retries=20 \129  CMD curl -sf --noproxy '*' http://127.0.0.1:5400/api/health || exit 1130 131ENTRYPOINT ["./docker/docker-entrypoint.sh"]132 133VOLUME /ql/data134  135EXPOSE 5700