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

chore: docker compose deployment #771

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

luojiyin1987
Copy link

抽象 简化 docker compose 部署

#770
#760

本来想用原来的 Dockerfile 构建镜像的, 考虑到前端可能不太熟悉 Nginx, 新建 build.yml 文件进行镜像构建。

副作用是构建镜像偏大,达1.6G。 如果有需求,可以在后期优化镜像大小。

Copy link

vercel bot commented Apr 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
qwerty-learner ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2024 0:05am

@HerbertHe
Copy link

@luojiyin1987 docker 构建的话可以用 node:alpine 的镜像,实际构建的结果小多了,还有就是 node16 已经放弃维护了,最新的lts 已经是 node20 了

@luojiyin1987
Copy link
Author

可以打包好的文件放到 nginx 的里, 镜像大小可以100 M 左右。我考虑的点是用 node 镜像运行的可以输出有关日志,方便调试。 用 Nginx 的镜像运行,镜像体积小。 @HerbertHe

# 第二阶段:运行应用
FROM nginx:alpine
WORKDIR /app
COPY ./public/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder  /app/build /app

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

Successfully merging this pull request may close these issues.

None yet

2 participants