FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r postgres && useradd -r -g postgres postgres RUN apt-get update && apt-get install -y curl RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' > /etc/apt/sources.list.d/pgdg.list RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - RUN apt-get update && apt-get install -y postgresql-9.3 RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.0/gosu' \ && chmod +x /usr/local/bin/gosu ENV PATH /usr/lib/postgresql/9.3/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data ADD ./docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 5432 CMD ["postgres"]