侧边栏壁纸
博主头像
★街角晚灯★博主等级

博观而约取 厚积而薄发

  • 累计撰写 466 篇文章
  • 累计创建 185 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

NodeJS-Pm2 |Jenkins构建|非Nginx版|NodeJSDockerfile

WinJay
2021-07-16 / 0 评论 / 0 点赞 / 141 阅读 / 3793 字 / 正在检测是否收录...
温馨提示:
文章发布较早,内容可能过时,阅读注意甄别。。。。

NodeJS-Pm2 |Jenkins构建|非Nginx版|NodeJSDockerfile

image-20230308114615504

Node v12.22.3

root@NodeTest:/app# npm config set registry https://registry.npm.taobao.org
root@NodeTest:/app# npm config get registry
https://registry.npm.taobao.org/
root@NodeTest:/app# npm install webpack -g
/usr/local/bin/webpack -> /usr/local/lib/node_modules/webpack/bin/webpack.js
+ webpack@5.44.0
added 73 packages from 120 contributors in 5.371s
root@NodeTest:/app# npm install

image.png
image.png
image.png

Node v15.5.1

image.png

image.png

docker run -itd -p 8002:80 --name NodeTest -h NodeTest -v /root/docker/003.NodeJS:/app node:12

docker run -itd -p 8002:80 --name NodeTest -h NodeTest  nodejs-12-test:12

Dockerfile示例

FROM node:19

# 修改系统阿里云镜像源
RUN echo 'deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib\r\ndeb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib\r\ndeb https://mirrors.aliyun.com/debian-security/ bullseye-security main\r\ndeb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main\r\ndeb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib\r\ndeb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib\r\ndeb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib\r\ndeb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib' > /etc/apt/sources.list


###安装视频转码组件FFmpeg###
RUN apt-get update -y && \
	apt-get upgrade -y && \
	apt install ffmpeg -y

WORKDIR /app

# Bundle app source
COPY . /app
RUN npm config set registry https://registry.npm.taobao.org
# 检查配置是否成功 npm config get registry
RUN npm install webpack -g
RUN npm install

EXPOSE 80
 CMD [ "npm", "start" ]
#CMD [ "/bin/bash" ]
FROM node:12

# 修改系统阿里云镜像源
RUN echo 'deb http://mirrors.163.com/debian/ buster main non-free contrib\\r\\ndeb http://mirrors.163.com/debian/ buster-updates main non-free contrib\\r\\ndeb http://mirrors.163.com/debian/ buster-backports main non-free contrib\\r\\ndeb-src http://mirrors.163.com/debian/ buster main non-free contrib\\r\\ndeb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib\\r\\ndeb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib\\r\\ndeb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\\r\\ndeb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\\r\\n' > /etc/apt/sources.list

###安装视频转码组件FFmpeg###
RUN apt-get update -y && \
	apt-get upgrade -y && \
	apt install ffmpeg -y

WORKDIR /app

# Bundle app source
COPY . /app
RUN npm config set registry https://registry.npm.taobao.org
# 检查配置是否成功 npm config get registry
RUN npm install webpack -g
RUN npm install

EXPOSE 80
CMD [ "npm", "start" ]
0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区