diff --git a/docker/image/Dockerfile b/docker/image/Dockerfile index 99fabeca..e8f1a422 100644 --- a/docker/image/Dockerfile +++ b/docker/image/Dockerfile @@ -1,9 +1,11 @@ FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:16-alpine -RUN npm install -g cross-env --registry=https://registry.npmmirror.com +RUN npm install cross-env -g --registry=https://registry.npmmirror.com +RUN npm install pm2 -g --registry=https://registry.npmmirror.com ADD ./workspace/certd-server/ /app/ WORKDIR /app/ +ENV NODE_ENV production RUN yarn install -P --registry=https://registry.npmmirror.com -CMD ["node","./bootstrap.js"] +CMD ["pm2-runtime", "start", "./bootstrap.js","--name", "certd","-i","1"] diff --git a/docker/run/Dockerfile b/docker/run/Dockerfile new file mode 100644 index 00000000..d7b53c81 --- /dev/null +++ b/docker/run/Dockerfile @@ -0,0 +1,7 @@ +FROM registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest +RUN npm install pm2 -g --registry=https://registry.npmmirror.com +CMD ["pm2-runtime", "start", "./bootstrap.js","--name", "certd","-i","1"] + + + + diff --git a/docker/run/docker-compose.yaml b/docker/run/docker-compose.yaml index 5f4f6c54..db9e3841 100644 --- a/docker/run/docker-compose.yaml +++ b/docker/run/docker-compose.yaml @@ -1,6 +1,9 @@ version: '3.3' # 指定docker-compose 版本 services: # 要拉起的服务们 certd: + build: + context: ./ + dockerfile: Dockerfile image: registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest container_name: certd # 容器名 restart: unless-stopped # 重启