mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 06:46:09 +08:00
大幅缩减docker镜像
This commit is contained in:
parent
5ebb9f4196
commit
688fdbff2a
|
@ -1,26 +1,3 @@
|
||||||
FROM node:lts-alpine as build
|
|
||||||
LABEL maintainer="whyour"
|
|
||||||
ARG QL_BASE_URL=https://github.com.cnpmjs.org/whyour/qinglong
|
|
||||||
ARG QL_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 \$ " \
|
|
||||||
QL_DIR=/ql
|
|
||||||
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 ${QL_BASE_BRANCH} ${QL_BASE_URL} ${QL_DIR} \
|
|
||||||
&& cd ${QL_DIR} \
|
|
||||||
&& cp -f .env.example .env \
|
|
||||||
&& yarn --network-timeout 100000
|
|
||||||
FROM node:lts-alpine
|
FROM node:lts-alpine
|
||||||
LABEL maintainer="whyour"
|
LABEL maintainer="whyour"
|
||||||
ARG QL_BASE_URL=https://github.com.cnpmjs.org/whyour/qinglong
|
ARG QL_BASE_URL=https://github.com.cnpmjs.org/whyour/qinglong
|
||||||
|
@ -45,9 +22,7 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
perl \
|
perl \
|
||||||
openssl \
|
openssl \
|
||||||
nginx \
|
nginx \
|
||||||
python \
|
python3 \
|
||||||
make \
|
|
||||||
g++ \
|
|
||||||
yarn \
|
yarn \
|
||||||
&& rm -rf /var/cache/apk/* \
|
&& rm -rf /var/cache/apk/* \
|
||||||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||||
|
@ -68,9 +43,8 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
&& chmod 777 ${QL_DIR}/shell/*.sh \
|
&& chmod 777 ${QL_DIR}/shell/*.sh \
|
||||||
&& chmod 777 ${QL_DIR}/docker/*.sh \
|
&& chmod 777 ${QL_DIR}/docker/*.sh \
|
||||||
&& npm install -g pm2 \
|
&& npm install -g pm2 \
|
||||||
&& rm -rf /root/.npm
|
&& rm -rf /root/.npm \
|
||||||
COPY --from=build /ql/node_modules /ql/node_modules/
|
&& yarn install --network-timeout 100000 \
|
||||||
RUN cd ${QL_DIR} \
|
|
||||||
&& yarn build \
|
&& yarn build \
|
||||||
&& yarn build-back \
|
&& yarn build-back \
|
||||||
&& yarn install --production --network-timeout 100000 \
|
&& yarn install --production --network-timeout 100000 \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user