1
- FROM node:16.13.1-alpine as build
1
+ FROM node:16.13.1-alpine AS build
2
2
ENV VUE_APP_NETEASE_API_URL=/api
3
3
WORKDIR /app
4
4
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\
5
5
apk add --no-cache python3 make g++ git
6
6
COPY package.json yarn.lock ./
7
- RUN yarn install
8
- COPY . .
9
7
RUN yarn config set electron_mirror https://npmmirror.com/mirrors/electron/ && \
10
- yarn build
8
+ yarn config set registry https://registry.npmmirror.com && \
9
+ sed -i 's/registry.yarnpkg.com/registry.npmmirror.com/g' yarn.lock && \
10
+ sed -i 's/registry.npmjs.org/registry.npmmirror.com/g' yarn.lock && \
11
+ yarn install
12
+ COPY . .
13
+ RUN yarn build
11
14
12
- FROM nginx:1.20.2-alpine as app
15
+ FROM nginx:1.20.2-alpine AS app
13
16
14
17
COPY --from=build /app/package.json /usr/local/lib/
15
18
16
- RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
17
- apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main libuv \
18
- && apk add --no-cache --update-cache --repository http ://dl-cdn.alpinelinux.org/alpine/v3.14/main nodejs npm \
19
+ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
20
+ && apk add --no-cache libuv nodejs npm \
21
+ && npm config set registry https ://registry.npmmirror.com \
19
22
&& npm i -g $(awk -F \" '{if($2=="NeteaseCloudMusicApi") print $2"@"$4}' /usr/local/lib/package.json) \
20
23
&& rm -f /usr/local/lib/package.json
21
24
22
25
COPY --from=build /app/docker/nginx.conf.example /etc/nginx/conf.d/default.conf
23
26
COPY --from=build /app/dist /usr/share/nginx/html
24
27
25
- CMD nginx ; exec npx NeteaseCloudMusicApi
28
+ CMD [ "sh" , "-c" , " nginx && exec npx NeteaseCloudMusicApi" ]
0 commit comments