Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 066d619

Browse files
committed
initial commit
0 parents  commit 066d619

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

pgsql/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# forked from https://gist.github.com/jpetazzo/5494158
2+
3+
FROM ubuntu:precise
4+
MAINTAINER synthomat "[email protected]"
5+
6+
# prevent apt from starting postgres right after the installation
7+
RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d; chmod +x /usr/sbin/policy-rc.d
8+
9+
RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y -q postgresql-9.1 postgresql-contrib-9.1
10+
11+
# allow autostart again
12+
RUN rm /usr/sbin/policy-rc.d
13+
14+
ADD . /usr/bin
15+
RUN chmod +x /usr/bin/start_pgsql.sh

pgsql/start_pgsql.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
# forked from https://gist.github.com/jpetazzo/5494158
3+
4+
echo 'host all all 0.0.0.0/0 md5' >> /etc/postgresql/9.1/main/pg_hba.conf
5+
su postgres sh -c "/usr/lib/postgresql/9.1/bin/postgres --single -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf" <<< "CREATE USER root WITH SUPERUSER PASSWORD '$1';"
6+
su postgres sh -c "/usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf -c listen_addresses=*"

0 commit comments

Comments
 (0)