From 11236c6445eebe3fa2364b7f86c33fafd7583bc9 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 29 Mar 2019 11:33:49 +0100 Subject: [PATCH] Fix docker issues --- Dockerfile | 2 +- container-start.sh | 14 +++++++++----- docker-compose.yml | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index d17da515e..974c10928 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ENV STORAGE=\'./storage/file\' ENV LOG_TO_STDOUT=true # Persistent storage needs -VOLUME /cryptpad/config +VOLUME /cryptpad/cfg VOLUME /cryptpad/datastore VOLUME /cryptpad/customize VOLUME /cryptpad/blobstage diff --git a/container-start.sh b/container-start.sh index 79d87030c..81338503a 100755 --- a/container-start.sh +++ b/container-start.sh @@ -4,8 +4,12 @@ mkdir -p customize # Copying default config -mkdir -p config -[ ! -f config/config.js ] && echo "Creating config.js" && cp config/config.example.js config/config.js +mkdir -p cfg +[ ! -f cfg/config.js ] && echo "Creating config.js" && cp config/config.example.js cfg/config.js + +# Linking config.js +[ ! -L config/config.js ] && echo "Linking config.js" && ln -s ../cfg/config.js config/config.js + # Thanks to http://stackoverflow.com/a/10467453 sedeasy() { @@ -14,13 +18,13 @@ sedeasy() { # Configure [ -n "$USE_SSL" ] && echo "Using secure websockets: $USE_SSL" \ - && sedeasy "useSecureWebsockets: [^,]*," "useSecureWebsockets: ${USE_SSL}," config/config.js + && sedeasy "useSecureWebsockets: [^,]*," "useSecureWebsockets: ${USE_SSL}," cfg/config.js [ -n "$STORAGE" ] && echo "Using storage adapter: $STORAGE" \ - && sedeasy "storage: [^,]*," "storage: ${STORAGE}," config/config.js + && sedeasy "storage: [^,]*," "storage: ${STORAGE}," cfg/config.js [ -n "$LOG_TO_STDOUT" ] && echo "Logging to stdout: $LOG_TO_STDOUT" \ - && sedeasy "logToStdout: [^,]*," "logToStdout: ${LOG_TO_STDOUT}," config/config.js + && sedeasy "logToStdout: [^,]*," "logToStdout: ${LOG_TO_STDOUT}," cfg/config.js export FRESH=1 exec node ./server.js diff --git a/docker-compose.yml b/docker-compose.yml index e0357287d..f30427b8f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,4 +26,4 @@ services: - ./data/blobstage:/cryptpad/blobstage:rw - ./data/tasks:/cryptpad/tasks:rw - ./data/block:/cryptpad/block:rw - - ./data/config:/cryptpad/config:rw + - ./data/config:/cryptpad/cfg:rw