forked from dequis/docker-postgresql-8.3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
25 lines (17 loc) · 1.04 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM debian:jessie
RUN apt-get update && apt-get install -y sudo wget ca-certificates
ADD pgdg.list /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update && LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive apt-get install -y -q postgresql-8.3 libpq-dev
# /etc/ssl/private can't be accessed from within container for some reason
# (@andrewgodwin says it's something AUFS related)
RUN mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private
## Add over config files
ADD postgresql.conf /etc/postgresql/8.3/main/postgresql.conf
ADD pg_hba.conf /etc/postgresql/8.3/main/pg_hba.conf
RUN chown postgres:postgres /etc/postgresql/8.3/main/*.conf
ADD init-postgresql /usr/local/bin/init-postgresql
RUN chmod +x /usr/local/bin/init-postgresql
VOLUME ["/var/lib/postgresql"]
EXPOSE 5432
CMD ["/usr/local/bin/init-postgresql"]