I know there is this option, but (and correct me if I'm mistaken) AFAIK that moves every docker volume to that directory, even non-mailcow things. Is there a way to only change the mailcow volumes? Like adding something to mailcow.conf like:
MAILCOW_DATA_DIR=directory
or
MAILCOW_VMAIL_DIR=directory
MAILCOW_MYSQL_DIR=directory
etc
Or is my only option is to edit the docker-compose.yml file for something like that? I really dont want to do that, since that will complicate things with updates. I guess I could make links in /var/lib/docker/volumes for each mailcow volume, but was wondering if there are other options.
You can create a file
docker-compose.override.yml
version: '2.1'
volumes:
vmail-vol-1:
driver_opts:
type: none
device: /data/mailcow/vmail
o: bind
mysql-vol-1:
driver_opts:
type: none
device: /data/mailcow/mysql
o: bind
redis-vol-1:
driver_opts:
type: none
device: /data/mailcow/redis
o: bind
rspamd-vol-1:
driver_opts:
type: none
device: /data/mailcow/rspamd
o: bind
postfix-vol-1:
driver_opts:
type: none
device: /data/mailcow/postfix
o: bind
crypt-vol-1:
driver_opts:
type: none
device: /data/mailcow/crypt
o: bind
rspamd-sock:
driver_opts:
type: none
device: /data/mailcow/rspamd-sock
o: bind
That's a cool way we should mention in the docs. :-) Do you want to create a PR?
It gave me a error when using it, something about wrong version. After adding version number from the docker-compose.yml to file it worked ok.
Yes, the version needs to be specified. Can you fix that. @daschxx ?
Most helpful comment
You can create a file