Skip to content

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

Description

@acmehades

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions