Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【server 5/7】RUN npm install #89

Closed
lsm2842035890 opened this issue Sep 22, 2024 · 4 comments
Closed

【server 5/7】RUN npm install #89

lsm2842035890 opened this issue Sep 22, 2024 · 4 comments

Comments

@lsm2842035890
Copy link

执行完docker compose up --build -d之后,构建到[server 5/7]RUN npm install的时候为什么这么慢,十几分钟还没结束,是镜像的原因吗,已经换成国内镜像了~

@lsm2842035890
Copy link
Author

解决了

@YuqiHuai
Copy link
Owner

@lsm2842035890 抱歉 是更换镜像后解决的吗?

@lsm2842035890
Copy link
Author

lsm2842035890 commented Sep 24, 2024

是的,在这里指定国内的源编译很快,用默认官方的源在国内巨慢
FROM node:18
RUN mkdir /workdir
ADD package.json /workdir

WORKDIR /workdir

RUN npm install --registry=https://registry.npmmirror.com
ADD ./ /workdir

EXPOSE 3000
RUN ["npm", "run", "build"]
CMD [ "npm", "run", "start" ]

@YuqiHuai
Copy link
Owner

好的 我迟点把这个信息弄得明显一点 感谢分享

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants