Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  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 apt-get update && apt-get install -y python-software-properties software-properties-common postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
  8.  
  9. USER postgres
  10.  
  11. RUN /etc/init.d/postgresql start &&\
  12. psql --command "ALTER USER postgres WITH PASSWORD 'postgres';" &&\
  13. createdb -O postgres polis
  14.  
  15. RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
  16.  
  17. RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
  18.  
  19. RUN echo "max_connections = 200" >> /etc/postgresql/9.3/main/postgresql.conf
  20.  
  21. EXPOSE 5432
  22.  
  23. VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
  24.  
  25. 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"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement