forked from CrazyRico/music-player-docker-build
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
47 lines (29 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM node:lts-alpine as mmPlayer_builder
# Maintainer
LABEL maintainer="Crazyrico Open Source Software <crazyrico@qq.com>"
# install dependencies and build tools
RUN apk update && apk add --no-cache wget curl git zip
WORKDIR /app
RUN git clone --recurse-submodules https://github.com/wujiyu115/Vue-mmPlayer.git
RUN cd Vue-mmPlayer \
&& echo 'VUE_APP_BASE_API_URL = /api' > .env \
&& npm install \
&& npm run build \
&& zip -r dist.zip dist
FROM node:lts-alpine
RUN apk update && apk add --no-cache bash wget curl git nginx unzip
WORKDIR /app
COPY --from=mmPlayer_builder /app/Vue-mmPlayer/dist.zip ./
RUN unzip dist.zip && rm -rf dist.zip
ADD default.conf /etc/nginx/http.d/
RUN cd /app && git clone https://github.com/wujiyu115/NeteaseCloudMusicApi.git
RUN cd NeteaseCloudMusicApi \
&& npm config set registry "https://registry.npmmirror.com/" \
&& npm install -g npm husky \
&& npm install --production
WORKDIR /app/NeteaseCloudMusicApi
ADD docker-entrypoint.sh ./
ADD check.sh ./
RUN chmod +x /app/NeteaseCloudMusicApi/*.sh
EXPOSE 80 443 5001
ENTRYPOINT ["./docker-entrypoint.sh"]