Update Dockerfile
Browse files- Dockerfile +3 -3
Dockerfile
CHANGED
|
@@ -4,8 +4,8 @@ FROM node:18-alpine
|
|
| 4 |
# 设置工作目录
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
RUN npm install -g pm2
|
| 9 |
|
| 10 |
# 克隆项目
|
| 11 |
RUN apk add --no-cache git && \
|
|
@@ -18,7 +18,7 @@ RUN yarn install
|
|
| 18 |
# 构建客户端代码
|
| 19 |
RUN yarn build:web
|
| 20 |
|
| 21 |
-
# 创建.env文件并设置JwtSecret
|
| 22 |
RUN echo "JwtSecret=your_random_secret_here" > .env
|
| 23 |
|
| 24 |
# 暴露端口
|
|
|
|
| 4 |
# 设置工作目录
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# 只安装pm2(因为yarn已经预装)
|
| 8 |
+
RUN npm install -g pm2
|
| 9 |
|
| 10 |
# 克隆项目
|
| 11 |
RUN apk add --no-cache git && \
|
|
|
|
| 18 |
# 构建客户端代码
|
| 19 |
RUN yarn build:web
|
| 20 |
|
| 21 |
+
# 创建.env文件并设置JwtSecret(生产环境应该使用更安全的方式)
|
| 22 |
RUN echo "JwtSecret=your_random_secret_here" > .env
|
| 23 |
|
| 24 |
# 暴露端口
|