From 0f8462dc7c11ddb0ce2de90dc8d7b3938bbf097a Mon Sep 17 00:00:00 2001 From: jedi Date: Wed, 6 Nov 2024 21:13:44 +0100 Subject: [PATCH] enforce startup order in docker-compose.yml --- deploy/dev/docker-compose.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/deploy/dev/docker-compose.yml b/deploy/dev/docker-compose.yml index 95e8083..dff5ab3 100644 --- a/deploy/dev/docker-compose.yml +++ b/deploy/dev/docker-compose.yml @@ -6,11 +6,17 @@ services: command: bash -c 'python manage.py migrate && python manage.py runserver 0.0.0.0:8000' environment: - HTTP_HOST=core - #- DATABASE_URL + - DB_HOST=db + - DB_PORT=3306 + - DB_NAME=system3 + - DB_USER=system3 + - DB_PASSWORD=system3 volumes: - ../../core:/code ports: - "8000:8000" + depends_on: + - db frontend: build: @@ -23,6 +29,8 @@ services: - ./vue.config.js:/web/vue.config.js ports: - "8080:8080" + depends_on: + - core db: image: mariadb @@ -30,4 +38,11 @@ services: MARIADB_RANDOM_ROOT_PASSWORD: true MARIADB_DATABASE: system3 MARIADB_USER: system3 - MARIADB_PASSWORD: system3 \ No newline at end of file + MARIADB_PASSWORD: system3 + volumes: + - mariadb_data:/var/lib/mysql + ports: + - "3306:3306" + +volumes: + mariadb_data: \ No newline at end of file