From 3be734f6fc4a011777bcadbd6716da41f5e50b74 Mon Sep 17 00:00:00 2001 From: JianMiau Date: Fri, 1 Sep 2023 17:45:19 +0800 Subject: [PATCH] [mod] --- Dockerfile | 10 +++++++--- package.json | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d1d63a4..09c3168 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM node +# sudo docker build -t guesswhoiams . +# sudo docker exec -it 2e8e3995aa52 /bin/bash + +FROM node:19.4.0 # 使用淘宝 NPM 镜像(国内机器构建推荐启用) # RUN npm config set registry https://registry.npm.taobao.org/ @@ -24,7 +27,8 @@ RUN rm -rf /app \ # ENV ENV NODE_ENV production -EXPOSE 3000 +EXPOSE 3003 WORKDIR /app -CMD node index.js \ No newline at end of file +# 指定啟動container後執行命令 +CMD [ "npm", "start" ] \ No newline at end of file diff --git a/package.json b/package.json index c948323..20448e9 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "main": "index.js", "private": true, "scripts": { + "start": "npm run dev", "dev": "tsrpc-cli dev", "debug": "nodemon --exec \"node --require ts-node/register --inspect=127.0.0.1:9229 src/index.ts\"", "build": "tsrpc-cli build",