Merge pull request #184 from noamyoyo/master #patch

Expose database container to allow access from MySQL client such as Workbench.
This commit is contained in:
Ponk
2023-08-15 19:32:09 +02:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -159,8 +159,8 @@ worlds:
server:
#Database Configuration
DB_URL_FORMAT: "jdbc:mysql://%s:3306/cosmic"
DB_HOST: "localhost"
DB_URL_FORMAT: "jdbc:mysql://%s:3306/cosmic" # If the docker ENV for DB_HOST is anything but "db", this string format should be changed from 3306 to 3307 (or whichever port it was changed to in docker)
DB_HOST: "localhost"
DB_USER: "cosmic_server"
DB_PASS: "snailshell"
INIT_CONNECTION_POOL_TIMEOUT: 90 # Seconds

View File

@@ -18,7 +18,7 @@ services:
- ./scripts:/opt/server/scripts
- ./wz:/opt/server/wz
environment:
DB_HOST: "db"
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
@@ -27,6 +27,8 @@ services:
MYSQL_DATABASE: "cosmic"
MYSQL_USER: "cosmic_server"
MYSQL_PASSWORD: "snailshell"
ports:
- "3307:3306"
volumes:
- ./database/docker-db-data:/var/lib/mysql
- ./database/sql:/docker-entrypoint-initdb.d