3 Star 9 Fork 5

RYMCU/nebula

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
Dockerfile 710 Bytes
Copy Edit Raw Blame History
ronger authored 2024-02-20 19:16 . ci(deps): 淘宝镜像服务地址变更
FROM node:16.17.0-alpine
#创建/opt/app 目录作为部署目录,创建容器实例时,挂载此目录
RUN mkdir -p /opt/app
# 设置工作目录
WORKDIR /opt/app
# 将代码复制到容器中
COPY . /opt/app
RUN cd /opt/app
# 添加权限,防止依赖无法安装
RUN chmod -R 777 *
# 添加执行shell文件权限
RUN chmod u+x pm2.sh
RUN yarn --registry=https://registry.npmmirror.com
RUN npm i pm2 -g --registry=https://registry.npmmirror.com
RUN npm run build
RUN ls -l -a
# 容器对外暴露的端口号,要和node项目配置的端口号一致
EXPOSE 3000
# 修复容器外无法访问问题
ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=3000
# 通过shell文件来执行多条命令
CMD ["./pm2.sh"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/rymcu/nebula.git
git@gitee.com:rymcu/nebula.git
rymcu
nebula
nebula
master

Search