From 977050f7a0685619da63b921876d4f08de80eebd Mon Sep 17 00:00:00 2001 From: Hubert Van De Walle Date: Thu, 30 Apr 2020 15:30:30 +0200 Subject: [PATCH] Add db persistent volume --- docker-compose.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6aabbda..0064d57 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,8 @@ services: ports: - 80:80 - 443:443 + depends_on: + - api db: @@ -30,9 +32,11 @@ services: ports: # This is only for testing - 3306:3306 + volumes: + - notes-db-volume:/var/lib/mysql healthcheck: test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] - timeout: 20s + timeout: 10s retries: 10 @@ -49,4 +53,7 @@ services: - MYSQL_HOST=db depends_on: db: - condition: service_healthy \ No newline at end of file + condition: service_healthy + +volumes: + notes-db-volume: \ No newline at end of file