Skip to content

Commit

Permalink
refine postgis docker with local volume mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
justb4 committed Apr 25, 2016
1 parent e1b48b8 commit b2d1be9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/platform/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,12 @@ PostGIS from Kartoza, see https://hub.docker.com/r/kartoza/postgis/ and https://
template_postgis | postgres | UTF8 | C | C |
(5 rows)


This shorthand script ``~/git/services/postgis/run-postgis.sh`` will (re)run the ``postgis`` container.

.. literalinclude:: ../../services/postgis/run-postgis.sh
:language: bash

ETL - Last Measurements
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
19 changes: 19 additions & 0 deletions services/postgis/run-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
#
# Run the Postgresql server with PostGIS and default database "gis".
#

GIT="/opt/geonovum/smartem/git"
LOG="/var/smartem/log"
NAME="postgis"
IMAGE="kartoza/postgis:9.4-2.1"

VOL_MAP="-v /var/smartem/data/postgresql:/var/lib/postgresql -v ${LOG}/postgresql:/var/log/postgresql"
PORT_MAP="-p 5432:5432"

# Stop and remove possibly old containers
sudo docker stop ${NAME} > /dev/null 2>&1
sudo docker rm ${NAME} > /dev/null 2>&1

# Finally run
sudo docker run --name ${NAME} ${PORT_MAP} ${VOL_MAP} -d -t ${IMAGE}

0 comments on commit b2d1be9

Please sign in to comment.