CikeyQi commited on
Commit
cfefbb9
·
1 Parent(s): af5a34b

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用基于 Node.js 18 的镜像
2
+ FROM node:18
3
+
4
+ # 安装 Redis
5
+ RUN apt-get update && apt-get install -y redis-server
6
+
7
+ # 将工作目录设置为 Yunzai 目录
8
+ WORKDIR /Yunzai
9
+
10
+ # 将 Redis 服务作为容器的一个后台进程启动
11
+ CMD ["redis-server", "--daemonize yes"]
12
+
13
+ # 复制 package.json 和 pnpm-lock.yaml 文件到容器中
14
+ COPY package.json pnpm-lock.yaml ./
15
+
16
+ # 安装依赖
17
+ RUN npm install -g pnpm
18
+ RUN pnpm install
19
+
20
+ # 将项目文件复制到容器中
21
+ COPY . .
22
+
23
+ # 启动应用程序
24
+ CMD ["node", "app.js"]