forked from DeLoWaN/docker-postgresql-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |