# node-back-end-cli **Repository Path**: huangz2350_admin/node-back-end-cli ## Basic Information - **Project Name**: node-back-end-cli - **Description**: 搭建nodejs的脚手架 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: dev - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-09 - **Last Updated**: 2026-03-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 使用说明 ## 1. 预装软件 - 安装Docker https://www.docker.com/,在此网站下载对应操作系统版本的Docker - 安装node https://www.runoob.com/nodejs/nodejs-install-setup.html ## 2. 拉取代码与编译 - 拉取代码: ```shell git clone https://gitee.com/huangz2350_admin/node-back-end-cli.git ``` - 编译代码 在开发中编译执行 ```shell npm run dev ``` - 编译Docker镜像 ```shell docker build -t node-filebeat-7120 . ``` 注意,Dockerfile文件中此处暂时不放开: ```dockerfile ADD ./start.sh /usr/local/bin/start.sh RUN chmod +x /usr/local/bin/start.sh # 下记代码如果需要后期修改filebeat内容或node代码更新,则下记功能不打开 # CMD [ "/usr/local/bin/start.sh" ] ``` - 运行Docker容器 ```shell docker run -it -d --hostname node-5001 -p 5001:5001 --name node-5001 \ -v node-back-end-cli:/root/node-back-end-cli \ -v filebeat.yml:/etc/filebeat/filebeat.yml \ node-filebeat-7120 /bin/bash /usr/local/bin/start.sh -D ``` - **-p:** docker容器对外暴露端口号 - **-v node-back-end-cli:/root/node-back-end-cli** : node脚手架项目路径 - **-v filebeat.yml:/etc/filebeat/filebeat.yml**:filebeat配置路径 - **/bin/bash /usr/local/bin/start.sh**:默认执行脚本路径