luoyutianyang commited on
Commit
b46a364
·
verified ·
1 Parent(s): e8e8d4b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -26,8 +26,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
26
  gstreamer1.0-libav \
27
  && rm -rf /var/lib/apt/lists/*
28
 
29
- # 安装Node.js和npm依赖
30
- RUN npm install -g node-gyp && npm install --unsafe-perm
 
 
 
 
 
 
31
 
32
  # 克隆OpenCV的源码库
33
  RUN git clone https://github.com/opencv/opencv.git ./opencv
@@ -48,14 +54,11 @@ RUN cmake -D CMAKE_BUILD_TYPE=Release \
48
  -D CMAKE_INSTALL_PREFIX=/usr/local \
49
  .. && make -j$(nproc) && make install
50
 
51
- # 安装opencv4nodejs
52
- RUN cd /app && npm install opencv4nodejs
53
-
54
  # 将当前目录的所有内容复制到工作目录
55
  COPY . .
56
 
57
  # 暴露端口
58
  EXPOSE 7860
59
 
60
- # 运行命令
61
- CMD ["node", "egg-api"]
 
26
  gstreamer1.0-libav \
27
  && rm -rf /var/lib/apt/lists/*
28
 
29
+ # 安装npm
30
+ RUN npm install -g npm@latest
31
+
32
+ # 安装node-gyp
33
+ RUN npm install -g node-gyp@latest
34
+
35
+ # 安装opencv4nodejs
36
+ RUN npm install opencv4nodejs
37
 
38
  # 克隆OpenCV的源码库
39
  RUN git clone https://github.com/opencv/opencv.git ./opencv
 
54
  -D CMAKE_INSTALL_PREFIX=/usr/local \
55
  .. && make -j$(nproc) && make install
56
 
 
 
 
57
  # 将当前目录的所有内容复制到工作目录
58
  COPY . .
59
 
60
  # 暴露端口
61
  EXPOSE 7860
62
 
63
+ # 运行egg-api.js
64
+ CMD ["node", "egg-api.js"]