Skip to content

Commit

Permalink
Docker improvements.
Browse files Browse the repository at this point in the history
Latest greatest upstream (PostgreSQL 9.5, etcd 2.2.5)
Install python packages using requirements file (vs installing from apt-get).
  • Loading branch information
feikesteenbergen committed Feb 3, 2016
1 parent 989443b commit af0db59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Expand Up @@ -12,17 +12,21 @@ RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update -y
RUN apt-get upgrade -y

ENV PGVERSION 9.4
RUN apt-get install python python-yaml python-requests python-boto postgresql-${PGVERSION} python-dnspython python-kazoo python-pip -y
RUN apt-get install python-dev postgresql-server-dev-${PGVERSION} -y
RUN pip install python-etcd psycopg2
ENV PGVERSION 9.5
RUN apt-get install postgresql-${PGVERSION} postgresql-server-dev-${PGVERSION} -y
RUN apt-get install python python-dev python-pip -y
ADD requirements-py2.txt /requirements-py2.txt
RUN pip install -r /requirements-py2.txt

ENV PATH /usr/lib/postgresql/${PGVERSION}/bin:$PATH

ADD patroni.py /patroni.py
ADD patroni/ /patroni

ENV ETCDVERSION 2.0.13
RUN ln -s /patroni.py /usr/local/bin/patroni
RUN ln -s /patronictl.py /usr/local/bin/patronictl

ENV ETCDVERSION 2.2.5
RUN curl -L https://github.com/coreos/etcd/releases/download/v${ETCDVERSION}/etcd-v${ETCDVERSION}-linux-amd64.tar.gz | tar xz -C /bin --strip=1 --wildcards --no-anchored etcd etcdctl

### Setting up a simple script that will serve as an entrypoint
Expand Down
3 changes: 2 additions & 1 deletion docker/entrypoint.sh
Expand Up @@ -119,7 +119,8 @@ postgresql:
archive_command: 'true'
max_wal_senders: 20
listen_addresses: 0.0.0.0
checkpoint_segments: 64
max_wal_size: 1GB
min_wal_size: 128MB
wal_keep_segments: 64
archive_timeout: 1800s
max_replication_slots: 20
Expand Down

0 comments on commit af0db59

Please sign in to comment.