mmdhx commited on
Commit
15e4dab
·
verified ·
1 Parent(s): 084bd67

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -8
Dockerfile CHANGED
@@ -32,17 +32,12 @@ RUN npm install -g node-gyp
32
  WORKDIR /app
33
  RUN git clone https://github.com/opencv/opencv.git ./opencv
34
 
35
- # 切换到指定的 OpenCV 版本
36
- WORKDIR /app/opencv
37
- RUN git checkout 4.1.0
38
-
39
  # 切换到 build 目录进行配置与编译
40
  WORKDIR /app/build
41
  RUN cmake -D WITH_FFMPEG=ON -D WITH_GSTREAMER=ON -D WITH_V4L=ON -D WITH_LIBV4L=ON -D WITH_GTK=ON -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ../opencv
42
 
43
- # 使用较少的并行编译进程
44
- RUN make -j2
45
-
46
  RUN make install
47
 
48
  # 全部复制到工作目录
@@ -50,9 +45,10 @@ COPY . .
50
 
51
  # 安装依赖
52
  RUN npm install
 
53
 
54
  # 暴露端口
55
  EXPOSE 7860
56
 
57
  # 运行
58
- CMD ["node", "egg-api.js"]
 
32
  WORKDIR /app
33
  RUN git clone https://github.com/opencv/opencv.git ./opencv
34
 
 
 
 
 
35
  # 切换到 build 目录进行配置与编译
36
  WORKDIR /app/build
37
  RUN cmake -D WITH_FFMPEG=ON -D WITH_GSTREAMER=ON -D WITH_V4L=ON -D WITH_LIBV4L=ON -D WITH_GTK=ON -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ../opencv
38
 
39
+ # 使用并行编译进程
40
+ RUN make -j$(nproc)
 
41
  RUN make install
42
 
43
  # 全部复制到工作目录
 
45
 
46
  # 安装依赖
47
  RUN npm install
48
+ RUN npm install serve-static
49
 
50
  # 暴露端口
51
  EXPOSE 7860
52
 
53
  # 运行
54
+ CMD ["node","egg-api"]