From cec8b623619182775c66ea7000f3f0bc96b1da27 Mon Sep 17 00:00:00 2001 From: Hazel Date: Thu, 25 Jan 2024 00:17:16 -0500 Subject: [PATCH] Modify docker compose syntax to support using environment variables --- docker-compose.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 90bbb04f..9a40a686 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: "3" services: maplestory: build: . @@ -18,15 +18,16 @@ services: - ./scripts:/opt/server/scripts - ./wz:/opt/server/wz environment: - DB_HOST: "db" ## Remember if this is present it will OVERRIDE the host in the config.yaml, if you put here anything other than db, you'll need to change the config.yaml jdbc string to port 3307, and not port 3306 + DB_HOST: "db" + # Remember if this is present it will OVERRIDE the host in the config.yaml, if you put here anything other than db, you'll need to change the config.yaml jdbc string to port 3307, and not port 3306 db: image: mysql:8.0.23 environment: - MYSQL_RANDOM_ROOT_PASSWORD: "true" - MYSQL_DATABASE: "cosmic" - MYSQL_USER: "cosmic_server" - MYSQL_PASSWORD: "snailshell" + - MYSQL_RANDOM_ROOT_PASSWORD=true + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} ports: - "3307:3306" volumes: