-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·24 lines (20 loc) · 1 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
export RAILS_ENV=${RAILS_ENV:-production}
export CAS_URL=${CAS_URL:-http://localhost:2000}
export WEB_HOSTNAME=${WEB_HOSTNAME:-`hostname`}
export SERVER_ADMIN=${SERVER_ADMIN:-}
export SUPPORT_EMAIL=${SUPPORT_EMAIL:-}
export ENABLE_STARTTLS_AUTO=${ENABLE_STARTTLS_AUTO:-true}
export SMTP_PORT=${SMTP_PORT:-25}
export DB_DATABASE=${DB_DATABASE:-signup}
export DB_USER=${DB_USER:-root}
export DB_PASS=${DB_PASS:-}
export DB_HOST=${DB_HOST:-mysql}
export DB_PORT=${DB_PORT:-3306}
perl -i -pe 's/\Q{{RAILS_ENV}}\E/$ENV{RAILS_ENV}/' /etc/apache2/apache2.conf
perl -i -pe 's/\Q{{WEB_HOSTNAME}}\E/$ENV{WEB_HOSTNAME}/' /etc/apache2/apache2.conf
perl -i -pe 's/\Q{{SERVER_ADMIN}}\E/$ENV{SERVER_ADMIN}/' /etc/apache2/apache2.conf
perl -i -pe 's/\Q{{ENABLE_STARTTLS_AUTO}}\E/$ENV{ENABLE_STARTTLS_AUTO}/' /usr/app/config/application.rb
perl -i -pe 's/\Q{{sslkeyfile}}\E/glob("\/ssl\/*.key.pem")/e' /etc/apache2/apache2.conf
perl -i -pe 's/\Q{{sslcertfile}}\E/glob("\/ssl\/*.cert.pem")/e' /etc/apache2/apache2.conf
exec "$@"