Skip to content

Option via .env to use bind mounts instead of volumes #2424

Description

@hertell

Hi,

I use always bind mounts instead of volumes in all my docker instances. I know many prefer to use volumes managed by docker, but i like to have full control of the content and location where stuff is saved. For this option to work smoothly, i would like to suggest the following addition for docker-compose.yaml so that i can specify a base path in an .env file where everyting would be saved instead of having to always having to modify the docker-compose file on every update

    volumes:
      - ${MOUNTPATH:+${MOUNTPATH}/}wazuh_api_configuration:/var/ossec/api/configuration
      - ${MOUNTPATH:+${MOUNTPATH}/}wazuh_etc:/var/ossec/etc
      - ...
      - ...

My own envs i usually put in an separate .env_override (docker compose --env-file .env --env-file .env_override up --wait) so that the maintainers .env file will not get in any conflict when pulling updates from git(hub)

# .env_override
MOUNTPATH=/path/to/wazuh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions