Skip to content

Commit

Permalink
fix: Add files
Browse files Browse the repository at this point in the history
  • Loading branch information
DeLoWaN committed Feb 11, 2016
1 parent 8e50016 commit b9b1335
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM debian:jessie

ENV PG_MAJOR 9.5
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8

RUN apt-get update && apt-get install -y \
postgresql-client-9.5

COPY entrypoint.sh /
RUN chmod u+x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
9 changes: 9 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

POSTGRES_USER=${POSTGRES_USER:-${DB_ENV_POSTGRES_USER}}
POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-${DB_ENV_POSTGRES_PASSWORD}}

echo "db:*:*:"${POSTGRES_USER}":"${POSTGRES_PASSWORD} > ~/.pgpass
chmod 0600 ~/.pgpass

"$@" -U ${POSTGRES_USER} -h db

0 comments on commit b9b1335

Please sign in to comment.