We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
commit 29ddb66
该提交完成了 Docker Compose 部署 compose-base.yaml :为基础环境配置 compose.yaml :为 server 服务配置
compose-base.yaml
compose.yaml
列下比较重要的知识点:
networks
Mysql
depends_on
healthcheck
Redis
depends_on: # 依赖的服务 mysql: condition: service_healthy # service_healthy 服务已经健康 redis: condition: service_started # service_started 服务已经启动
build
context
.mod
.
build: context: . # 构建的路径 dockerfile: ./restful/user/Dockerfile # 指定 Dockerfile 文件
# 启动所有服务 # -f 指定docker-compose文件 docker compose -f compose-base.yaml -f compose.yaml up --build # 启动指定服务 # --build server 表示重新构建服务,server 表示服务名称 # --no-deps 表示不启动依赖服务 docker compose -f compose-base.yaml -f compose.yaml up --build server --no-deps
The text was updated successfully, but these errors were encountered:
orange-juzipi
No branches or pull requests
commit 29ddb66
该提交完成了 Docker Compose 部署
compose-base.yaml
:为基础环境配置compose.yaml
:为 server 服务配置列下比较重要的知识点:
networks
Mysql
,虽然已经使用了depends_on
配置等待依赖的环境启动,但无法检测到是否已经就绪,所以需要在Mysql
环境中添加healthcheck
健康检查,该命令能执行到,证明 Mysql 已经就绪,最后才启动 server。Redis
可以不需要healthcheck
。build
,context
指的是构建路径,.mod
在根路径就填.
就行,但该服务的 Dockerfile 在不同的路径,则需手动填写到对应服务 Dockerfile 。The text was updated successfully, but these errors were encountered: