2022-01-11 19:07:48 +08:00
|
|
|
FROM node:16.13.1-alpine as build
|
2022-01-08 19:26:11 +08:00
|
|
|
ENV VUE_APP_NETEASE_API_URL=/api
|
|
|
|
WORKDIR /app
|
2023-12-08 18:46:10 +08:00
|
|
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\
|
|
|
|
apk add --no-cache python3 make g++ git
|
2022-01-22 21:07:33 +08:00
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
RUN yarn install
|
|
|
|
COPY . .
|
2023-12-08 18:46:10 +08:00
|
|
|
RUN yarn config set electron_mirror https://npmmirror.com/mirrors/electron/ && \
|
|
|
|
yarn build
|
2022-01-08 19:26:11 +08:00
|
|
|
|
2022-01-11 19:07:48 +08:00
|
|
|
FROM nginx:1.20.2-alpine as app
|
2022-01-30 00:19:55 +08:00
|
|
|
|
2022-06-19 20:54:08 +08:00
|
|
|
COPY --from=build /app/package.json /usr/local/lib/
|
|
|
|
|
2023-12-08 18:46:10 +08:00
|
|
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\
|
|
|
|
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main libuv \
|
2022-01-30 00:19:55 +08:00
|
|
|
&& apk add --no-cache --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main nodejs npm \
|
2022-11-19 17:39:25 +08:00
|
|
|
&& npm i -g $(awk -F \" '{if($2=="NeteaseCloudMusicApi") print $2"@"$4}' /usr/local/lib/package.json) \
|
|
|
|
&& rm -f /usr/local/lib/package.json
|
2022-01-30 00:19:55 +08:00
|
|
|
|
2022-11-19 18:35:29 +08:00
|
|
|
COPY --from=build /app/docker/nginx.conf.example /etc/nginx/conf.d/default.conf
|
2022-01-30 00:19:55 +08:00
|
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
2022-01-08 19:26:11 +08:00
|
|
|
|
2023-12-08 18:52:54 +08:00
|
|
|
CMD nginx ; exec npx NeteaseCloudMusicApi
|