32 lines
788 B
Bash
Executable File
32 lines
788 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
echo -n "Starting up at "
|
|
date -Iseconds
|
|
|
|
if [ ! -e /etc/ssl/dhparam.pem ]; then
|
|
# We don't generate it automatically, because it should be mounted from
|
|
# the Docker host and generated only once, rather than every time a new
|
|
# container is created.
|
|
echo "/etc/ssl/dhparam.pem missing, generate with:"
|
|
echo
|
|
echo " openssl dhparam -out /etc/ssl/dhparams.pem 4096"
|
|
echo
|
|
echo "GENERATING TEMPORARY INSECURE FILE"
|
|
openssl dhparam -out /etc/ssl/dhparams.pem 512
|
|
fi
|
|
|
|
if [ ! -e $PGDATA ]; then
|
|
echo "$PGDATA does not exist, initialising database"
|
|
. /create_db.sh
|
|
else
|
|
echo "Starting postgresql"
|
|
pg_ctlcluster 10 main start
|
|
fi
|
|
|
|
echo "Starting nginx in foreground"
|
|
nginx -g 'daemon off;'
|
|
|
|
echo -n "Done at "
|
|
date -Iseconds
|