Skip to content

Commit

Permalink
make postgres start optional for Docker container (#2323)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbelnap authored and nathandunn committed Nov 18, 2019
1 parent 7acd535 commit 1f90932
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docker-files/createenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ echo "export WEBAPOLLO_DB_NAME=${WEBAPOLLO_DB_NAME}" >> $SET_ENV_FILE
echo "export WEBAPOLLO_DB_USERNAME=${WEBAPOLLO_DB_USERNAME}" >> $SET_ENV_FILE
echo "export WEBAPOLLO_DB_PASSWORD=${WEBAPOLLO_DB_PASSWORD}" >> $SET_ENV_FILE

# Indicates if we want to start our own postgres server
echo "export WEBAPOLLO_START_POSTGRES=${WEBAPOLLO_START_POSTGRES}" >> $SET_ENV_FILE

# Indicates if we use Chado. Default 'true'.
echo "export WEBAPOLLO_USE_CHADO=${WEBAPOLLO_USE_CHADO}" >> $SET_ENV_FILE

Expand Down
6 changes: 5 additions & 1 deletion docker-files/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ if [ ! -e "${WEBAPOLLO_DB_DATA}/PG_VERSION" ];then
su -c "/usr/lib/postgresql/9.6/bin/initdb -D ${WEBAPOLLO_DB_DATA}" postgres
fi

service postgresql start
export WEBAPOLLO_START_POSTGRES="${WEBAPOLLO_START_POSTGRES:true}"

if [[ "${WEBAPOLLO_START_POSTGRES}" == "true" ]]; then
service postgresql start
fi

export WEBAPOLLO_DB_HOST="${WEBAPOLLO_DB_HOST:-127.0.0.1}"
export WEBAPOLLO_DB_NAME="${WEBAPOLLO_DB_NAME:-apollo}"
Expand Down

0 comments on commit 1f90932

Please sign in to comment.