-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,78 +2,6 @@ FROM python:3.10-alpine as builder | |
COPY package.json .npmrc pnpm-lock.yaml /tmp/build/ | ||
RUN set -x \ | ||
&& apk update \ | ||
&& apk add nodejs npm yarn git \ | ||
&& yarn global add [email protected] \ | ||
&& cd /tmp/build \ | ||
&& pnpm --registry https://registry.npmmirror.com install --prod | ||
|
||
FROM python:3.10-alpine | ||
|
||
ARG QL_MAINTAINER="whyour" | ||
LABEL maintainer="${QL_MAINTAINER}" | ||
ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git | ||
ARG QL_BRANCH=develop | ||
|
||
ENV PNPM_HOME=/root/.local/share/pnpm \ | ||
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 \ | ||
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 \ | ||
LANG=C.UTF-8 \ | ||
SHELL=/bin/bash \ | ||
PS1="\u@\h:\w \$ " \ | ||
QL_DIR=/ql \ | ||
QL_BRANCH=${QL_BRANCH} | ||
|
||
RUN set -x \ | ||
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \ | ||
&& apk update -f \ | ||
&& apk upgrade \ | ||
&& apk --no-cache add -f bash \ | ||
coreutils \ | ||
git \ | ||
curl \ | ||
wget \ | ||
tzdata \ | ||
perl \ | ||
openssl \ | ||
nginx \ | ||
nodejs \ | ||
jq \ | ||
openssh \ | ||
procps \ | ||
netcat-openbsd \ | ||
yarn \ | ||
npm \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& apk update \ | ||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | ||
&& echo "Asia/Shanghai" > /etc/timezone \ | ||
&& git config --global user.email "qinglong@@users.noreply.github.com" \ | ||
&& git config --global user.name "qinglong" \ | ||
&& git config --global http.postBuffer 524288000 \ | ||
&& yarn global add [email protected] \ | ||
&& cd && pnpm config set registry https://registry.npmmirror.com \ | ||
&& pnpm add -g pm2 tsx \ | ||
&& rm -rf /root/.pnpm-store \ | ||
&& rm -rf /root/.local/share/pnpm/store \ | ||
&& rm -rf /root/.cache \ | ||
&& rm -rf /usr/local/share/.cache/yarn | ||
|
||
ARG SOURCE_COMMIT | ||
RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \ | ||
&& cd ${QL_DIR} \ | ||
&& cp -f .env.example .env \ | ||
&& chmod 777 ${QL_DIR}/shell/*.sh \ | ||
&& chmod 777 ${QL_DIR}/docker/*.sh \ | ||
&& git clone --depth=1 -b ${QL_BRANCH} https://github.com/${QL_MAINTAINER}/qinglong-static.git /static \ | ||
&& mkdir -p ${QL_DIR}/static \ | ||
&& cp -rf /static/* ${QL_DIR}/static \ | ||
&& rm -rf /static | ||
|
||
COPY --from=builder /tmp/build/node_modules/. /ql/node_modules/ | ||
|
||
WORKDIR ${QL_DIR} | ||
|
||
HEALTHCHECK --interval=5s --timeout=2s --retries=20 \ | ||
CMD curl -sf http://127.0.0.1:5400/api/health || exit 1 | ||
|
||
ENTRYPOINT ["./docker/docker-entrypoint.sh"] | ||
&& apk add nodejs npm \ | ||
&& timeout 10s npm -v \ | ||
&& cd && ls -alh |