diff --git a/docker-compose.yaml b/docker-compose.yaml index 31c8ece..a204341 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,4 @@ -version: '3.8' +version: "3.8" services: node: @@ -11,7 +11,8 @@ services: expose: - "3000" depends_on: - - db + db: + condition: service_healthy nginx: image: nginx:1.25.3-alpine @@ -33,4 +34,10 @@ services: - ./bootstrap.sql:/docker-entrypoint-initdb.d/1.sql environment: MYSQL_ROOT_PASSWORD: "root" - MYSQL_DATABASE: fullcycle \ No newline at end of file + MYSQL_DATABASE: fullcycle + healthcheck: + test: ["CMD", "mysqladmin", "-uroot", "-proot", "ping", "-hlocalhost"] + interval: 5s + timeout: 10s + retries: 3 + start_period: 3s