web525 commited on
Commit
4c3f291
·
1 Parent(s): 3012327
Files changed (2) hide show
  1. Dockerfile +5 -7
  2. start.sh +5 -2
Dockerfile CHANGED
@@ -1,18 +1,16 @@
1
- # 使用EasyNode官方镜像
2
  FROM chaoszhu/easynode:latest
3
 
4
- # 1. 直接使用镜像内置的权限设置
5
- # 2. 安装必要的Nginx
6
- USER root
7
  RUN apk update && apk add --no-cache nginx
8
 
9
- # 3. 创建配置文件
10
  COPY nginx.conf /etc/nginx/nginx.conf
 
 
11
  COPY start.sh /start.sh
12
  RUN chmod +x /start.sh
13
 
14
- # 4. 切换回基础镜像的默认用户(通常是node或非root用户)
15
- USER 1000
16
 
17
  EXPOSE 7860
18
  CMD ["/start.sh"]
 
 
1
  FROM chaoszhu/easynode:latest
2
 
3
+ # 安装Nginx
 
 
4
  RUN apk update && apk add --no-cache nginx
5
 
6
+ # 创建Nginx配置文件
7
  COPY nginx.conf /etc/nginx/nginx.conf
8
+
9
+ # 创建启动脚本
10
  COPY start.sh /start.sh
11
  RUN chmod +x /start.sh
12
 
13
+ # 不修改用户权限,使用基础镜像的默认用户
 
14
 
15
  EXPOSE 7860
16
  CMD ["/start.sh"]
start.sh CHANGED
@@ -1,5 +1,8 @@
1
  #!/bin/bash
2
- # 启动EasyNode(在后台运行,使用8082端口)
 
3
  node /easynode/app/index.js --port 8082 &
4
- # 启动Nginx(前台运行)
 
 
5
  nginx -g "daemon off;"
 
1
  #!/bin/bash
2
+ # 启动EasyNode
3
+ echo "Starting EasyNode..."
4
  node /easynode/app/index.js --port 8082 &
5
+
6
+ # 启动Nginx
7
+ echo "Starting Nginx..."
8
  nginx -g "daemon off;"