bout as good as it gets
1 file changed, +2 -1
+2-1docker-entrypoint.sh
| @@ -1,14 +1,15 @@ | ||
| 1 | 1 | #!/bin/sh |
| 2 | +echo "Beginning of huncho web entrypoint." | |
| 2 | 3 | |
| 3 | 4 | if [ ! -d /var/lib/postgresql/data ];then |
| 4 | 5 | mkdir /var/lib/postgresql/data |
| 5 | 6 | fi |
| 6 | 7 | |
| 7 | -# take care of postgres business | |
| 8 | 8 | chmod 700 /var/lib/postgresql/data |
| 9 | 9 | chown -R postgres:postgres /var/lib/postgresql/data |
| 10 | 10 | su -s /bin/sh postgres <<EOF |
| 11 | 11 | cd |
| 12 | +echo "Switched to postgres user" | |
| 12 | 13 | if [ -z $(ls /var/lib/postgresql/data) ];then |
| 13 | 14 | echo 'No data found, initializing postgres.' |
| 14 | 15 | initdb -D data > /dev/null > /dev/null 2>&1 |