rensl commited on
Commit
7938e48
·
verified ·
1 Parent(s): ce9bf5e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -6
Dockerfile CHANGED
@@ -1,14 +1,29 @@
1
  FROM node:20-slim as nodebuilder
2
 
3
  FROM python:3.11-slim-bullseye as builder
4
- COPY package.json .npmrc pnpm-lock.yaml /tmp/build/
 
 
 
 
 
 
 
5
  COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/
6
  COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/
7
  RUN set -x && \
8
  ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
9
  apt-get update && \
10
- apt-get install --no-install-recommends -y git libatomic1 && \
11
- npm i -g pnpm@8.3.1 && \
 
 
 
 
 
 
 
 
12
  cd /tmp/build && \
13
  pnpm install --prod
14
 
@@ -19,7 +34,6 @@ LABEL maintainer="${QL_MAINTAINER}"
19
  ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git
20
  ARG QL_BRANCH=debian
21
 
22
-
23
  ENV PNPM_HOME=/root/.local/share/pnpm \
24
  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 \
25
  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 \
@@ -32,7 +46,6 @@ ENV PNPM_HOME=/root/.local/share/pnpm \
32
  COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/
33
  COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/
34
 
35
-
36
  RUN set -x && \
37
  ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
38
  ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \
@@ -102,13 +115,14 @@ COPY --from=builder /tmp/build/node_modules/. /ql/node_modules/
102
 
103
  WORKDIR ${QL_DIR}
104
 
 
105
  # Set up a new user named "user" with user ID 1000
106
  RUN useradd -m -u 1000 user
107
 
108
  # Switch to the "user" user
109
  USER user
110
 
111
- # 创建rclone配置文件
112
  RUN rclone config -h
113
 
114
  HEALTHCHECK --interval=5s --timeout=2s --retries=20 \
 
1
  FROM node:20-slim as nodebuilder
2
 
3
  FROM python:3.11-slim-bullseye as builder
4
+ ARG QL_MAINTAINER="whyour"
5
+ LABEL maintainer="${QL_MAINTAINER}"
6
+ ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git
7
+ ARG QL_BRANCH=debian
8
+
9
+ ENV QL_DIR=/ql \
10
+ QL_BRANCH=${QL_BRANCH}
11
+
12
  COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/
13
  COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/
14
  RUN 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
+
23
+ RUN mkdir /tmp/build
24
+ RUN cp ${QL_DIR}/package.json ${QL_DIR}/.npmrc ${QL_DIR}/pnpm-lock.yaml /tmp/build/
25
+
26
+ RUN npm i -g pnpm@8.3.1 && \
27
  cd /tmp/build && \
28
  pnpm install --prod
29
 
 
34
  ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git
35
  ARG QL_BRANCH=debian
36
 
 
37
  ENV 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 \
 
46
  COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/
47
  COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/
48
 
 
49
  RUN 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 && \
 
115
 
116
  WORKDIR ${QL_DIR}
117
 
118
+
119
  # Set up a new user named "user" with user ID 1000
120
  RUN useradd -m -u 1000 user
121
 
122
  # Switch to the "user" user
123
  USER user
124
 
125
+ # Create rclone configuration file
126
  RUN rclone config -h
127
 
128
  HEALTHCHECK --interval=5s --timeout=2s --retries=20 \