From 3e8a5bd74c66c839c86516cd2e7574223a481c36 Mon Sep 17 00:00:00 2001 From: whyour Date: Mon, 22 Mar 2021 13:16:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=A9=E5=87=8Fdocker=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E8=87=B3940M?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 932d1eeb..3f01ea63 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,3 +1,26 @@ +FROM node:lts-alpine as build +LABEL maintainer="whyour" +ARG JD_BASE_URL=https://github.com.cnpmjs.org/whyour/qinglong +ARG JD_BASE_BRANCH=master +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + LANG=zh_CN.UTF-8 \ + SHELL=/bin/bash \ + PS1="\u@\h:\w \$ " \ + JD_DIR=/jd +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \ + && apk update -f \ + && apk upgrade \ + && apk --no-cache add -f coreutils \ + moreutils \ + git \ + python \ + make \ + g++ \ + yarn \ + && git clone -b ${JD_BASE_BRANCH} ${JD_BASE_URL} ${JD_DIR} \ + && cd ${JD_DIR} \ + && cp -f .env.example .env \ + && yarn --network-timeout 100000 FROM node:lts-alpine LABEL maintainer="whyour" ARG JD_BASE_URL=https://github.com.cnpmjs.org/whyour/qinglong @@ -41,8 +64,9 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && ln -sf ${JD_DIR}/shell/export_sharecodes.sh /usr/local/bin/export_sharecodes \ && ln -sf ${JD_DIR}/shell/git_diy.sh /usr/local/bin/diy \ && ln -sf ${JD_DIR}/shell/notify.sh /usr/local/bin/notify \ - && ln -sf ${JD_DIR}/shell/rebuild.sh /usr/local/bin/rebuild \ - && yarn install --network-timeout 100000 \ + && ln -sf ${JD_DIR}/shell/rebuild.sh /usr/local/bin/rebuild +COPY --from=build /jd/node_modules /jd/node_modules/ +RUN cd ${JD_DIR} \ && yarn build \ && yarn build-back \ && git clone -b ${JD_SCRIPTS_BRANCH} ${JD_SCRIPTS_URL} ${JD_DIR}/scripts \