From 6a69b94a44d14cf5541c1f80972fd0614fef3720 Mon Sep 17 00:00:00 2001 From: Shuai Lin Date: Tue, 14 Aug 2018 11:26:07 +0800 Subject: [PATCH] Added some comments --- image/seafile/Dockerfile | 1 - scripts/bootstrap.py | 4 ++++ scripts/create_data_links.sh | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/image/seafile/Dockerfile b/image/seafile/Dockerfile index 28d2b4f..96b9046 100644 --- a/image/seafile/Dockerfile +++ b/image/seafile/Dockerfile @@ -13,6 +13,5 @@ ADD scripts/create_data_links.sh /etc/my_init.d/01_create_data_links.sh COPY scripts /scripts COPY templates /templates -COPY bootstrap.conf /opt/bootstrap.conf CMD ["/sbin/my_init", "--", "/scripts/start.py"] diff --git a/scripts/bootstrap.py b/scripts/bootstrap.py index bfba2aa..6b21a85 100755 --- a/scripts/bootstrap.py +++ b/scripts/bootstrap.py @@ -144,6 +144,10 @@ def init_seafile_server(): fp.write('UNIX_SOCKET = /opt/seafile/ccnet.sock\n') fp.write('\n') + # After the setup script creates all the files inside the + # container, we need to move them to the shared volume + # + # e.g move "/opt/seafile/seafile-data" to "/shared/seafile/seafile-data" files_to_copy = ['conf', 'ccnet', 'seafile-data', 'seahub-data', 'pro-data'] for fn in files_to_copy: src = join(topdir, fn) diff --git a/scripts/create_data_links.sh b/scripts/create_data_links.sh index bb2ea95..e24508b 100755 --- a/scripts/create_data_links.sh +++ b/scripts/create_data_links.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -e set -o pipefail if [[ $SEAFILE_BOOTSRAP != "" ]]; then @@ -53,6 +53,7 @@ media_dirs=( ) for d in ${media_dirs[*]}; do source_media_dir=${current_version_dir}/seahub/media/$d + # move files in media/avatars, e.g. media/avatars/default.jpg to seahub-data/avatars if [ -e ${source_media_dir} ] && [ ! -e ${seahub_data_dir}/$d ]; then mv $source_media_dir ${seahub_data_dir}/$d fi