From 34914111d34e3b94aaad1fcca87b80fad6a11013 Mon Sep 17 00:00:00 2001 From: Joshua Schmitt Date: Wed, 12 Feb 2020 13:34:05 -0600 Subject: [PATCH] copy database files to data folder --- Readme.md | 2 +- scripts/start.sh | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 5a5d9d3f..67d5b650 100644 --- a/Readme.md +++ b/Readme.md @@ -24,7 +24,7 @@ This command will pull, create, and start the container: Without persistent volume: -```bash +```shell docker run --detach --publish 8080:9392 -e PASSWORD="Your admin password here" --name gvm securecompliance/gvm ``` With persistent volume: diff --git a/scripts/start.sh b/scripts/start.sh index a5a46ee2..12f88f38 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -29,15 +29,18 @@ echo "Redis ready." if [ ! -d /data ]; then - echo "Create Data folder" + echo "Creating Data folder..." mkdir /data fi if [ ! -d /data/database ]; then - echo "Create Database folder" - mkdir /data/database - mkdir -p /var/lib/postgresql/10 + echo "Creating Database folder..." + if [ -d /var/lib/postgresql/10/main ]; then + mv /var/lib/postgresql/10/main /data/database + fi ln -s /data/database /var/lib/postgresql/10/main + chown postgres:postgres -R /var/lib/postgresql/10/main + chown postgres:postgres -R /data/database fi echo "Starting PostgreSQL..."