Tony Mack | 7ca8c52 | 2015-10-29 21:14:41 +0000 | [diff] [blame] | 1 | FROM ubuntu |
| 2 | |
| 3 | RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 |
| 4 | |
| 5 | RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list |
| 6 | |
| 7 | RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --force-yes\ |
| 8 | python-software-properties \ |
| 9 | software-properties-common \ |
| 10 | postgresql-9.3 \ |
| 11 | postgresql-client-9.3 \ |
| 12 | postgresql-contrib-9.3 |
| 13 | |
| 14 | USER postgres |
| 15 | |
| 16 | RUN /etc/init.d/postgresql start && \ |
| 17 | psql --command "ALTER USER postgres WITH SUPERUSER PASSWORD 'password';" |
| 18 | |
| 19 | # Allow remote connections. |
| 20 | RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf |
| 21 | |
| 22 | RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf |
| 23 | |
| 24 | # Expose the PostgreSQL port |
| 25 | EXPOSE 5432 |
| 26 | |
| 27 | VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"] |
| 28 | |
| 29 | CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"] |