Skip to content

Commit

Permalink
更新docker compose启动时等待mysql初始化完成
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhongjia committed Oct 30, 2023
1 parent 33d5647 commit afb1a82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ services:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: 123456 # 数据库root密码
MYSQL_DATABASE: movie # 初始化的数据库名
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10

movie:
depends_on:
- db
db:
condition: service_healthy
image: "yunyizhiying/movie"
container_name: movie
ports:
Expand Down

0 comments on commit afb1a82

Please sign in to comment.