feat(docker): update optimized Dockerfile and compose for CN environment

This commit is contained in:
2025-03-25 21:43:45 +08:00
parent d43b4b73b9
commit 4d87d34f6e
3 changed files with 180 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
FROM dockerp.com/alpine:latest AS builder
RUN sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirror.nju.edu.cn/alpine#g' /etc/apk/repositories && apk add --no-cache git npm
WORKDIR /app
RUN git clone https://gh-proxy.com/github.com/wylieconlon/jsonrpc-ws-proxy.git
WORKDIR /app/jsonrpc-ws-proxy
COPY servers.yml .
RUN npm config set registry https://repo.nju.edu.cn/repository/npm/ && npm install && npm run prepare
FROM dockerp.com/alpine:latest
RUN sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirror.nju.edu.cn/alpine#g' /etc/apk/repositories && apk add --no-cache build-base clang-extra-tools nodejs
WORKDIR /app/jsonrpc-ws-proxy
COPY --from=builder /app/jsonrpc-ws-proxy .
EXPOSE 3000
CMD ["node", "dist/server.js", "--port", "3000", "--languageServers", "servers.yml"]