From 25bb0972b992cf4e8fce122e7ca22941a33fd72c Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 30 Jan 2022 12:31:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile | 6 +----- docker/base/Dockerfile | 6 ++++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 90b86dbe..d9743bc0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,11 +18,7 @@ RUN git clone -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \ && cp -f .env.example .env \ && chmod 777 ${QL_DIR}/shell/*.sh \ && chmod 777 ${QL_DIR}/docker/*.sh \ - && sed -i '/sqlite3/d' package.json \ - && pnpm install --prod \ - && cp -rf /usr/local/pnpm-global/5/node_modules/sqlite3 ./node_modules/ \ - && cp -rf /usr/local/pnpm-global/5/node_modules/.pnpm/sqlite* ./node_modules/.pnpm/ \ - && git checkout . \ + && cp -rf /node_modules ./ \ && pnpm install --prod \ && rm -rf /root/.pnpm-store \ && git clone -b ${QL_BRANCH} https://github.com/${QL_MAINTAINER}/qinglong-static.git /static \ diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index a3296198..eb1da45c 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -7,6 +7,7 @@ ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ SHELL=/bin/bash \ PS1="\u@\h:\w \$ " +COPY package.json / RUN set -x \ && sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ @@ -37,7 +38,8 @@ RUN set -x \ && git config --global user.name "qinglong" \ && npm install -g pnpm \ && pnpm install -g pm2 \ - && pnpm install -g ts-node typescript tslib sqlite3 \ - && rm -rf /root/.npm \ + && pnpm install -g ts-node typescript tslib \ + && cd / && pnpm install --prod \ + && rm -rf /root/.npm CMD [ "node" ]