xiaoju-survey/Dockerfile
2024-02-07 15:56:16 +08:00

24 lines
590 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 镜像集成
FROM node:16
# 设置工作区间
WORKDIR /xiaoju-survey
# 复制文件到工作区间
COPY . /xiaoju-survey
RUN npm config set registry https://registry.npmjs.org/
# 安装项目依赖
RUN cd /xiaoju-survey/web && npm install && npm run build
# 用了后端服务代理启动建议使用nginx启动
RUN cd /xiaoju-survey && cp -af ./web/dist/* ./server/public/
RUN cd /xiaoju-survey/server && npm install && npm run build
# 暴露端口 需要跟server的port一致
EXPOSE 3000
# docker入口文件,运行pm2启动,并保证监听不断
CMD ["sh","docker-run.sh"]