mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 05:08:04 +00:00
Support unblock via docker.
This commit is contained in:
parent
fd40a29180
commit
e997cd9907
3 changed files with 35 additions and 6 deletions
11
Dockerfile
11
Dockerfile
|
|
@ -1,17 +1,20 @@
|
||||||
FROM node:16.13.1-alpine as build
|
FROM node:16.13.1-alpine as build
|
||||||
ENV VUE_APP_NETEASE_API_URL=/api
|
ENV VUE_APP_NETEASE_API_URL=/api
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apk add --no-cache python3 make g++ git
|
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
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
RUN yarn install
|
RUN yarn install
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN yarn build
|
RUN yarn config set electron_mirror https://npmmirror.com/mirrors/electron/ && \
|
||||||
|
yarn build
|
||||||
|
|
||||||
FROM nginx:1.20.2-alpine as app
|
FROM nginx:1.20.2-alpine as app
|
||||||
|
|
||||||
COPY --from=build /app/package.json /usr/local/lib/
|
COPY --from=build /app/package.json /usr/local/lib/
|
||||||
|
|
||||||
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main libuv \
|
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 \
|
||||||
&& apk add --no-cache --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main nodejs npm \
|
&& apk add --no-cache --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main nodejs npm \
|
||||||
&& npm i -g $(awk -F \" '{if($2=="NeteaseCloudMusicApi") print $2"@"$4}' /usr/local/lib/package.json) \
|
&& npm i -g $(awk -F \" '{if($2=="NeteaseCloudMusicApi") print $2"@"$4}' /usr/local/lib/package.json) \
|
||||||
&& rm -f /usr/local/lib/package.json
|
&& rm -f /usr/local/lib/package.json
|
||||||
|
|
@ -19,4 +22,4 @@ RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/m
|
||||||
COPY --from=build /app/docker/nginx.conf.example /etc/nginx/conf.d/default.conf
|
COPY --from=build /app/docker/nginx.conf.example /etc/nginx/conf.d/default.conf
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
CMD nginx ; exec npx NeteaseCloudMusicApi
|
CMD nginx ; exec env NODE_TLS_REJECT_UNAUTHORIZED=0 npx NeteaseCloudMusicApi
|
||||||
|
|
@ -8,5 +8,30 @@ services:
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 1202:80
|
||||||
restart: always
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- UnblockNeteaseMusic
|
||||||
|
environment:
|
||||||
|
- NODE_TLS_REJECT_UNAUTHORIZED=0
|
||||||
|
networks:
|
||||||
|
my_network:
|
||||||
|
|
||||||
|
UnblockNeteaseMusic:
|
||||||
|
image: pan93412/unblock-netease-music-enhanced
|
||||||
|
command: -o bilibili kugou kuwo pyncmd -p 80:443 -f 59.111.19.99
|
||||||
|
environment:
|
||||||
|
- NODE_TLS_REJECT_UNAUTHORIZED=0
|
||||||
|
networks:
|
||||||
|
my_network:
|
||||||
|
aliases:
|
||||||
|
- music.163.com
|
||||||
|
- interface.music.163.com
|
||||||
|
- interface3.music.163.com
|
||||||
|
- interface.music.163.com.163jiasu.com
|
||||||
|
- interface3.music.163.com.163jiasu.com
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
networks:
|
||||||
|
my_network:
|
||||||
|
driver: bridge
|
||||||
|
|
@ -23,6 +23,7 @@ server {
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
proxy_set_header X-Forwarded-Host $remote_addr;
|
||||||
proxy_set_header X-NginX-Proxy true;
|
proxy_set_header X-NginX-Proxy true;
|
||||||
|
|
||||||
proxy_pass http://localhost:3000/;
|
proxy_pass http://localhost:3000/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue