forked from coop-cloud/mattermost
20 lines
701 B
Bash
20 lines
701 B
Bash
#!/bin/sh
|
|
set -e
|
|
if test -f "/run/secrets/postgres_password"; then
|
|
pwd=`cat /run/secrets/postgres_password`
|
|
if [ -z $pwd ]; then
|
|
echo >&2 "error: /run/secrets/postgres_password is empty"
|
|
exit 1
|
|
fi
|
|
echo "abra-mattermost-entrypoint.sh setting POSTGRES_PASSWORD and MM_SQLSETTINGS_DATASOURCE"
|
|
export "POSTGRES_PASSWORD"="$pwd"
|
|
export "MM_SQLSETTINGS_DATASOURCE"="postgres://mattermost:${pwd}@postgres:5432/mattermost?sslmode=disable&connect_timeout=10"
|
|
unset "pwd"
|
|
else
|
|
echo >&2 "error: /run/secrets/postgres_password does not exist"
|
|
exit 1
|
|
fi
|
|
|
|
# https://github.com/mattermost/mattermost-server/blob/master/build/Dockerfile
|
|
/entrypoint.sh "mattermost"
|