Added mounting volume with openstack.

This commit is contained in:
yohan 2020-02-26 17:40:13 +01:00
parent 1109f80fdf
commit 8e467b7509
2 changed files with 23 additions and 8 deletions

View File

@ -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

21
start.sh Executable file
View File

@ -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