From b6096aadfa80b6406efa0c048ce56262caf746bc Mon Sep 17 00:00:00 2001 From: Birkhoff Lee Date: Tue, 3 Dec 2019 21:31:56 +0800 Subject: [PATCH] Add MariaDB to docker-compose example 1. Gives an example set up of a MySQL database in docker-compose 2. `php` now depends on `db`, and `nginx` depends on `php`. This ensures the integrity of the stack. --- docker-compose.yml.example | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml.example b/docker-compose.yml.example index 48bdda1a..c58181df 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -3,7 +3,9 @@ version: '3.1' services: nginx: - image: nginx + image: nginx + depends_on: + - php expose: - 80 volumes: @@ -12,7 +14,17 @@ services: php: build: . + depends_on: + - db expose: - 9000 restart: always + db: + image: mariadb + restart: always + environment: + MYSQL_USER: crater + MYSQL_PASSWORD: crater + MYSQL_DATABASE: crater +