Fix docker run.sh

This commit is contained in:
Paul Makles
2020-08-30 18:56:43 +01:00
parent ab2a510bc6
commit c95dc19f67
2 changed files with 19 additions and 11 deletions

18
run.sh
View File

@@ -1,12 +1,22 @@
#!/bin/bash
export $(egrep -v '^#' .env | xargs)
# Split at \n instead of space.
# https://unix.stackexchange.com/a/39482
set -f
IFS='
'
input=($(egrep -v '^#' .env))
prepended=(${input[@]/#/-e\"})
variables=${prepended[@]/%/\"}
unset IFS
set +f
echo "Running Revolt in detached mode."
docker run \
-d \
--name revolt \
-p 8000:8000 \
-p 9000:9000 \
-e "DB_URI=$DB_URI" \
-e "PUBLIC_URI=$PUBLIC_URI" \
-e "PORTAL_URL=$PORTAL_URI" \
$variables \
revolt