luoyutianyang commited on
Commit
112e437
·
verified ·
1 Parent(s): 8bea36d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -11
Dockerfile CHANGED
@@ -1,19 +1,29 @@
1
- # 使用适合你操作系统架构的archlinux镜像作为基础镜像
2
- FROM justadudewhohacks/opencv-nodejs
3
-
4
- # 安装依赖
5
- RUN npm install
6
- RUN npm install express
7
- RUN npm install opencv4nodejs
8
 
9
  # 设置工作目录
10
  WORKDIR /app
11
 
12
- # 拷贝应用程序代码到容器中
13
- COPY . .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- # 暴露端口(如果需要)
16
  EXPOSE 7860
17
 
18
- # 启动应用程序
19
  CMD [ "node", "egg-api.js" ]
 
1
+ # 使用适合你操作系统架构的 archlinux 镜像作为基础镜像
2
+ FROM archlinux:latest
 
 
 
 
 
3
 
4
  # 设置工作目录
5
  WORKDIR /app
6
 
7
+ # 复制应用程序代码到工作目录
8
+ COPY . .
9
+
10
+ # 更新软件包数据库并安装需要的软件包
11
+ RUN pacman -Syu --noconfirm && \
12
+ pacman -S --noconfirm \
13
+ nodejs npm cmake opencv icu gcc git base-devel
14
+
15
+ # 安装 Node.js 依赖
16
+ RUN npm install -g npm express phin npmlog jimp axios sharp
17
+
18
+ # 克隆 opencv4nodejs 仓库并安装
19
+ RUN cd /usr/lib/node_modules && \
20
+ git clone https://github.com/justadudewhohacks/opencv4nodejs.git && \
21
+ cd opencv4nodejs && \
22
+ npm -g i nan native-node-utils npmlog && \
23
+ node install/install.js
24
 
25
+ # 暴露端口
26
  EXPOSE 7860
27
 
28
+ # 启动应用
29
  CMD [ "node", "egg-api.js" ]