diff --git a/README.md b/README.md index aaa3a022..230c2a58 100644 --- a/README.md +++ b/README.md @@ -62,9 +62,7 @@ ### 3️⃣ Create docker-compose.yml Create a `docker-compose.yml` file in your project directory: -```ini -version: '3.8' - +```yaml services: booklore: image: ghcr.io/adityachandelgit/booklore-app:${BOOKLORE_IMAGE_TAG} @@ -72,7 +70,8 @@ ### 3️⃣ Create docker-compose.yml env_file: - .env depends_on: - - mariadb + mariadb: + condition: service_healthy ports: - "6060:6060" volumes: @@ -87,6 +86,11 @@ ### 3️⃣ Create docker-compose.yml volumes: - ${MARIADB_CONFIG_PATH}:/config restart: unless-stopped + healthcheck: + test: ["CMD", "mariadb-admin", "ping", "-h", "localhost"] + interval: 10s + timeout: 5s + retries: 5 ``` Note: You can find the latest BookLore image tag `BOOKLORE_IMAGE_TAG` (e.g. v.0.x.x) from the Releases section: 📦 [Latest Image Tag – GitHub Releases](https://github.com/adityachandelgit/BookLore/releases) diff --git a/example-docker/docker-compose.yml b/example-docker/docker-compose.yml index 254e4191..5678ae7c 100644 --- a/example-docker/docker-compose.yml +++ b/example-docker/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3.8' services: booklore: image: ghcr.io/adityachandelgit/booklore-app:${BOOKLORE_IMAGE_TAG} @@ -6,7 +5,8 @@ services: env_file: - .env depends_on: - - mariadb + mariadb: + condition: service_healthy ports: - "6060:6060" volumes: @@ -20,4 +20,9 @@ services: - .env volumes: - ${MARIADB_CONFIG_PATH}:/config - restart: unless-stopped \ No newline at end of file + restart: unless-stopped + healthcheck: + test: ["CMD", "mariadb-admin", "ping", "-h", "localhost"] + interval: 10s + timeout: 5s + retries: 5 \ No newline at end of file