azerothcore / azerothcore/acore-cms

Enhancement: Add environment variable for MySQL data volume path in docker-compose.yml

Open
#186 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
78
Forks
43
Avg merge
13m
Merged PRs (30d)
1

Description

Hi AzerothCore Team,
I'm currently deploying acore-cms on a NAS environment using Docker. I've noticed a minor inconsistency in how volumes are handled, which affects users who need to store data on specific drive partitions (non-system partitions).

The Current Situation:
The **wordpress-src** volume is already configurable via the **${DOCKER_WORDPRESS_SRC_PATH}** environment variable. This works perfectly.
However, the **mysql-data** volume in the wp-db service is hardcoded as a named volume.

The Problem:
When trying to change the MySQL data path using a **docker-compose.override.yml** file, Docker still creates an empty named volume folder in the default system directory (e.g., /var/lib/docker/volumes/mysql-data) because override appends to the list rather than replacing the named volume definition. This leads to redundant folders and "orphaned" volumes on the system drive.

Proposed Solution:
Introduce a new environment variable for the MySQL data path, similar to how it's done for the WordPress source.Update the **wp-db** service in **docker-compose.yml** from:
` - mysql-data:/var/lib/mysql`
to
` - ${DOCKER_WORDPRESS_DB_PATH:-mysql-data}:/var/lib/mysql`

Benefits:
1.Flexibility: Users can easily redirect the database storage to a specific NAS folder or external drive via the .env file
2..Consistency: Aligns the configuration method with DOCKER_WORDPRESS_SRC_PATH.
3.Cleanliness: Avoids the creation of unwanted named volumes when a bind mount is preferred in an override file.

Thank you for your great work on the Acore project!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.