Skip to content

Commit 3cb2ab2

Browse files
committed
Initial commit
0 parents  commit 3cb2ab2

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

AUTHORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Mike Dillon <[email protected]>
2+
3+
And other contributors not specifically named here.

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM postgres:9.3
2+
MAINTAINER Mike Dillon <[email protected]>
3+
4+
ENV POSTGIS_MAJOR 2.1
5+
ENV POSTGIS_VERSION 2.1.4+dfsg-1.pgdg70+2
6+
7+
RUN echo deb http://http.debian.net/debian wheezy-backports main >> /etc/apt/sources.list
8+
RUN apt-get update \
9+
&& apt-get install -y \
10+
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
11+
postgis=$POSTGIS_VERSION \
12+
&& rm -rf /var/lib/apt/lists/*
13+
14+
# Need to replace upstream entrypoint to allow postgis initialization
15+
COPY ./docker-entrypoint.sh /

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2014, Docker PostGIS Authors (See AUTHORS)
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

docker-entrypoint.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ "$1" = 'postgres' ]; then
5+
chown -R postgres "$PGDATA"
6+
7+
if [ -z "$(ls -A "$PGDATA")" ]; then
8+
gosu postgres initdb
9+
10+
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
11+
12+
{ echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf
13+
fi
14+
15+
exec gosu postgres "$@"
16+
fi
17+
18+
exec "$@"

0 commit comments

Comments
 (0)