moved configuration bits to init script

This commit is contained in:
Sameer Naik
2014-06-28 23:12:23 +05:30
parent 22035c8ee6
commit 23700349b9
3 changed files with 15 additions and 34 deletions
+2 -2
View File
@@ -3,11 +3,11 @@ MAINTAINER sameer@damagehead.com
RUN apt-get update && \
apt-get install -y postgresql postgresql-client && \
rm -rf /var/lib/postgresql && \
apt-get clean # 20140525
ADD assets/ /app/
RUN chmod 755 /app/init /app/setup/install
RUN /app/setup/install
RUN chmod 755 /app/init
EXPOSE 5432
+13
View File
@@ -6,6 +6,19 @@ set -e
chown -R postgres:postgres /var/lib/postgresql
chmod 700 /var/lib/postgresql
# disable ssl
sed 's/ssl = true/#ssl = true/' -i /etc/postgresql/9.1/main/postgresql.conf
# listen on all interfaces
cat >> /etc/postgresql/9.1/main/postgresql.conf <<EOF
listen_addresses = '*'
EOF
# allow remote connections to postgresql database
cat >> /etc/postgresql/9.1/main/pg_hba.conf <<EOF
host all all 0.0.0.0/0 md5
EOF
# initialize PostgreSQL data directory
if [ ! -d /var/lib/postgresql/9.1/main ]; then
echo "Initializing database..."
-32
View File
@@ -1,32 +0,0 @@
#!/bin/bash
set -e
# make sure ssl is disabled
sed 's/ssl = true/#ssl = true/' -i /etc/postgresql/9.1/main/postgresql.conf
# listen on all interfaces
cat >> /etc/postgresql/9.1/main/postgresql.conf <<EOF
listen_addresses = '*'
EOF
# allow remote connections to postgresql database
cat >> /etc/postgresql/9.1/main/pg_hba.conf <<EOF
host all all 0.0.0.0/0 md5
EOF
# remove the default database, will create from init
rm -rf /var/lib/postgresql/9.1/main
echo ""
echo "*************************************************************************"
echo "* Please login to postgresql and create the required database and *"
echo "* database user with remote login access so that other containers can *"
echo "* use it. *"
echo "* *"
echo "* e.g. *"
echo "* sudo -u postgres createuser db_user *"
echo "* sudo -u postgres psql *"
echo "* > \password db_user *"
echo "* sudo -u postgres createdb -O db_user db_name *"
echo "*************************************************************************"
echo ""