-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (26 loc) · 962 Bytes
/
Dockerfile
File metadata and controls
41 lines (26 loc) · 962 Bytes
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
# build
FROM node:22-alpine AS builder
# install pnpm
RUN npm install -g pnpm
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
# skip postinstall
RUN pnpm install --frozen-lockfile --ignore-scripts
COPY . .
# add .env.example to .env
RUN [ ! -e ".env" ] && cp .env.example .env || true
# skip native build for web deployment
ENV SKIP_NATIVE_BUILD=true
RUN npx electron-vite build
# nginx
FROM nginx:1.27-alpine-slim AS app
COPY --from=builder /app/out/renderer /usr/share/nginx/html
COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/docker-entrypoint.sh /docker-entrypoint.sh
RUN apk add --no-cache npm python3 \
&& npm install -g @unblockneteasemusic/server @neteasecloudmusicapienhanced/api \
&& sed -i 's/\r$//' /docker-entrypoint.sh \
&& chmod +x /docker-entrypoint.sh
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["npx", "@neteasecloudmusicapienhanced/api"]