| # 使用适合你操作系统架构的Node.js镜像作为基础镜像 | |
| FROM archlinux:latest | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 复制应用程序代码到工作目录 | |
| COPY . . | |
| RUN pacman -Sy | |
| RUN pacman -S nodejs --noconfirm | |
| RUN pacman -S npm --noconfirm | |
| RUN pacman -S cmake --noconfirm | |
| RUN pacman -S opencv --noconfirm | |
| # 安装Node.js依赖 | |
| RUN npm install express | |
| RUN npm install are-we-there-yet | |
| RUN npm install gauge | |
| RUN npm install npmlog | |
| RUN npm install opencv4nodejs | |
| RUN npm install jimp | |
| RUN npm install axios | |
| RUN npm install sharp | |
| # 暴露端口 | |
| EXPOSE 7860 | |
| # 启动应用 | |
| CMD [ "node", "egg-api.js" ] |