diff --git a/docker-compose.yml b/docker-compose.yml index 8f3aa6e..9bae496 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,15 +12,9 @@ services: - '80' - '443' volumes: - - onlyoffice_data:/var/www/onlyoffice/Data - - onlyoffice_log:/var/log/onlyoffice + - /mnt/volumes/onlyoffice_data/data:/var/www/onlyoffice/Data + - /mnt/volumes/onlyoffice_log/data:/var/log/onlyoffice networks: reverse-proxy: external: true - -volumes: - onlyoffice_data: - external: true - onlyoffice_log: - external: true diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..05f9c38 --- /dev/null +++ b/start.sh @@ -0,0 +1,21 @@ +#!/bin/bash +source ~/openrc.sh +INSTANCE=$(/home/yohan/env_py3/bin/openstack server show -c id --format value $(hostname)) +mkdir -p /mnt/volumes/onlyoffice_data +if ! mountpoint -q /mnt/volumes/onlyoffice_data +then + VOLUME_ID=$(/home/yohan/env_py3/bin/openstack volume show onlyoffice_data -c id --format value) + test -e /dev/disk/by-id/*${VOLUME_ID:0:20} || nova volume-attach $INSTANCE $VOLUME_ID auto + sleep 3 + sudo mount /dev/disk/by-id/*${VOLUME_ID:0:20} /mnt/volumes/onlyoffice_data +fi +mkdir -p /mnt/volumes/onlyoffice_log +if ! mountpoint -q /mnt/volumes/onlyoffice_log +then + VOLUME_ID=$(/home/yohan/env_py3/bin/openstack volume show onlyoffice_log -c id --format value) + test -e /dev/disk/by-id/*${VOLUME_ID:0:20} || nova volume-attach $INSTANCE $VOLUME_ID auto + sleep 3 + sudo mount /dev/disk/by-id/*${VOLUME_ID:0:20} /mnt/volumes/onlyoffice_log +fi + +sudo docker-compose up -d