编写 Dockerfile
FROM alpine
EXPOSE 8899
RUN apk add --no-cache nodejs npm \
&& npm install whistle -g \
&& apk del npm \
&& mkdir /whistle
ENTRYPOINT ["w2", "run", "-M","prod", "-D","/whistle"]
构建镜像
$ docker build -t whistle:v1 .
启动容器
$ docker run -d --name whistle -p 8899:8899 whistle:v1
或者使用 docker-compose 启动,编写 yml 文件
version: "3"
services:
whistle:
image: whistle:v1
container_name: whistle
restart: always
volumes:
- "/volume/whistle:/whistle"
- "/volume/whistle/.WhistleAppData:/root/.WhistleAppData"
ports:
- "8899:8899"
标签:npm,v1,8899,whistle,Whistle,host,&&,Docker,docker
From: https://www.cnblogs.com/abeelan/p/17215425.html