Merge pull request #137 from mattermost/fixapp

Do not use env variables to override APP conf. (fix #136)
This commit is contained in:
Kyâne Pichou 2017-06-10 18:19:47 +02:00 committed by GitHub
commit 16071fdc8f
3 changed files with 23 additions and 32 deletions

View File

@ -4,25 +4,11 @@ FROM ubuntu:14.04
ENV PATH="/mattermost/bin:${PATH}"
ENV MM_VERSION=3.9.0
# Override default config
ENV MM_SERVICESETTINGS_LISTENADDRESS=":80" \
MM_LOGSETTINGS_ENABLECONSOLE=false \
MM_LOGSETTINGS_CONSOLELEVEL="INFO" \
MM_FILESETTINGS_DIRECTORY="/mattermost/data/" \
MM_FILESETTINGS_ENABLEPUBLICLINK=true \
MM_FILESETTINGS_PUBLICLINKSALT="A705AklYF8MFDOfcwh3I488G8vtLlVip" \
MM_EMAILSETTINGS_SENDEMAILNOTIFICATIONS=false \
MM_EMAILSETTINGS_FEEDBACKEMAIL="" \
MM_EMAILSETTINGS_SMTPSERVER="" \
MM_EMAILSETTINGS_SMTPPORT="" \
MM_EMAILSETTINGS_INVITESALT="bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS" \
MM_RATELIMITSETTINGS_ENABLE=true \
MM_SQLSETTINGS_DRIVERNAME="postgres"
# Install some needed packages
RUN apt-get update \
&& apt-get -y install \
curl \
jq \
netcat \
&& rm -rf /var/lib/apt/lists/*

View File

@ -4,25 +4,11 @@ FROM ubuntu:14.04
ENV PATH="/mattermost/bin:${PATH}"
ENV MM_VERSION=3.9.0
# Override default config
ENV MM_SERVICESETTINGS_LISTENADDRESS=":80" \
MM_LOGSETTINGS_ENABLECONSOLE=false \
MM_LOGSETTINGS_CONSOLELEVEL="INFO" \
MM_FILESETTINGS_DIRECTORY="/mattermost/data/" \
MM_FILESETTINGS_ENABLEPUBLICLINK=true \
MM_FILESETTINGS_PUBLICLINKSALT="A705AklYF8MFDOfcwh3I488G8vtLlVip" \
MM_EMAILSETTINGS_SENDEMAILNOTIFICATIONS=false \
MM_EMAILSETTINGS_FEEDBACKEMAIL="" \
MM_EMAILSETTINGS_SMTPSERVER="" \
MM_EMAILSETTINGS_SMTPPORT="" \
MM_EMAILSETTINGS_INVITESALT="bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS" \
MM_RATELIMITSETTINGS_ENABLE=true \
MM_SQLSETTINGS_DRIVERNAME="postgres"
# Install some needed packages
RUN apt-get update \
&& apt-get -y install \
curl \
jq \
netcat \
&& rm -rf /var/lib/apt/lists/*

View File

@ -20,10 +20,29 @@ if [ "$1" = 'platform' ]; then
esac
done
echo "Using config file" $MM_CONFIG
if [ ! -f $MM_CONFIG ]
then
echo "No configuration file" $MM_CONFIG
echo "Creating a new one"
# Copy default configuration file
cp /config.json.save $MM_CONFIG
# Substitue some parameters with jq
jq '.ServiceSettings.ListenAddress = ":80"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.LogSettings.EnableConsole = false' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.LogSettings.ConsoleLevel = "INFO"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.FileSettings.Directory = "/mattermost/data/"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.FileSettings.EnablePublicLink = true' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.FileSettings.PublicLinkSalt = "A705AklYF8MFDOfcwh3I488G8vtLlVip"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.EmailSettings.SendEmailNotifications = false' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.EmailSettings.FeedbackEmail = ""' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.EmailSettings.SMTPServer = ""' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.EmailSettings.SMTPPort = ""' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.EmailSettings.InviteSalt = "bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.RateLimitSettings.Enable = true' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
jq '.SqlSettings.DriverName = "postgres"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
else
echo "Using existing config file" $MM_CONFIG
fi
echo -ne "Configure database connection..."