mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-09-11 12:10:47 +08:00
clean up init script, removed unnecessary stuff
This commit is contained in:
+1
-2
@@ -13,5 +13,4 @@ EXPOSE 5432
|
|||||||
|
|
||||||
VOLUME ["/var/lib/postgresql"]
|
VOLUME ["/var/lib/postgresql"]
|
||||||
|
|
||||||
ENTRYPOINT ["/app/init"]
|
CMD ["/app/init"]
|
||||||
CMD ["app:start"]
|
|
||||||
|
|||||||
+1
-33
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
appStart () {
|
|
||||||
# fix permissions and ownership of /var/lib/postgresql
|
# fix permissions and ownership of /var/lib/postgresql
|
||||||
chown -R postgres:postgres /var/lib/postgresql
|
chown -R postgres:postgres /var/lib/postgresql
|
||||||
chmod 700 /var/lib/postgresql
|
chmod 700 /var/lib/postgresql
|
||||||
@@ -30,36 +29,5 @@ appStart () {
|
|||||||
echo "| from the data store. |"
|
echo "| from the data store. |"
|
||||||
echo "|------------------------------------------------------------------|"
|
echo "|------------------------------------------------------------------|"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tail -F /var/log/postgresql/postgresql-9.1-main.log
|
tail -F /var/log/postgresql/postgresql-9.1-main.log
|
||||||
}
|
|
||||||
|
|
||||||
appHelp () {
|
|
||||||
echo "Available options:"
|
|
||||||
echo " app:start - Start the postgresql server and watch the log (default)"
|
|
||||||
echo " app:help - Displays the help"
|
|
||||||
echo " [command] - Execute the specified linux command eg. bash."
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
app:start)
|
|
||||||
appStart
|
|
||||||
;;
|
|
||||||
app:help)
|
|
||||||
appHelp
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
if [ -x $1 ]; then
|
|
||||||
$1
|
|
||||||
else
|
|
||||||
prog=$(which $1)
|
|
||||||
if [ -n "${prog}" ] ; then
|
|
||||||
shift 1
|
|
||||||
$prog $@
|
|
||||||
else
|
|
||||||
appHelp
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|||||||
Reference in New Issue
Block a user