forked from GeoNode/django-osgeo-importer
-
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.
Merge pull request GeoNode#89 from JivanAmara/docker-dev
Docker images for postgres & geoserver with docker-compose for developing from a virtualenv.
- Loading branch information
Showing
5 changed files
with
48 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,16 @@ | ||
version: '2' | ||
services: | ||
postgres: | ||
build: "postgres-postgis/" | ||
image: "postgresql-postgis:9.3-2.3" | ||
ports: | ||
- "5432:5432" | ||
expose: | ||
- "5432" | ||
geoserver: | ||
build: "geoserver/" | ||
image: "geoserver-host-postgres:2.9.2" | ||
ports: | ||
- "8080:8080" | ||
links: | ||
- postgres |
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,8 @@ | ||
# Provides this geoserver image with 'localhost' remapped to the host machine so db requests are made to host port 5432. | ||
from winsent/geoserver:2.9.2 | ||
|
||
ENV TERM=linux | ||
|
||
COPY startup_extra.sh /opt/geoserver/bin/startup_extra.sh | ||
RUN chmod a+x /opt/geoserver/bin/startup_extra.sh | ||
CMD ["/opt/geoserver/bin/startup_extra.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,12 @@ | ||
#!/bin/bash | ||
echo "Redirecting container's 'localhost' to container host." | ||
|
||
# Since this docker container is for a developer using a virtualenv on the host, this is a bit of | ||
# a hack so when a database with host 'localhost' in the project settings file | ||
# has its config passed to geoserver it will reference the host the developer expects. | ||
HOST_IP=`ip route | grep default | awk '{ printf "%s",$3 }'` | ||
|
||
cat /etc/hosts | sed "s/127.0.0.1/$HOST_IP/" > /tmp/etc_hosts | ||
cp /tmp/etc_hosts /etc/hosts | ||
|
||
/opt/geoserver/bin/startup.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,3 @@ | ||
from mdillon/postgis:9.3 | ||
|
||
COPY init-user-db.sh /docker-entrypoint-initdb.d/init-user-db.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 | ||
set -e | ||
|
||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL | ||
CREATE USER osgeo WITH PASSWORD 'osgeo'; | ||
ALTER USER osgeo WITH SUPERUSER; | ||
CREATE DATABASE osgeo WITH OWNER osgeo; | ||
GRANT ALL PRIVILEGES ON DATABASE osgeo TO osgeo; | ||
EOSQL |