FROM node:16-alpine
RUN npm config set registry http://mirrors.cloud.tencent.com/npm/
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN npm install -g whistle
RUN w2 i whistle.inspect
EXPOSE 8899
CMD ["w2", "run", "-M", "prod"]
Dockerfile:
CMD ["w2", "run", "-M", "prod"]
表示 whistle 以生产模式运行于前台,如果需要加认证可以添加参数:参考文档:http://wproxy.org/whistle/