diff --git a/docs/install.rst b/docs/install.rst index 06a66a514f..8cfe37a8a6 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -26,44 +26,26 @@ Replace username and db name accordingly. In Docker ~~~~~~~~~ +To run Postgres 9.6.3 with postgis 2.3.0 in Docker: -These are just examples and you shouldn't run them as they are in production: -To run this use the Dockerfile in -`onaio/docker-builds `_ -for postgres 9.6.0 with postgis 2.3.0 and run: +We shall use the Ona Docker builds `onaio/docker-builds ` .. code-block:: sh - mkdir ~/docker-images/postgres-9.6/ - cd ~/docker-images/postgres-9.6 - docker build -t postgres:9.6.1 . + git clone git@github.com:onaio/docker-builds.git + cd docker-builds/postgresql + mkdir ~/.postgresql/onadata/data + POSTGRES_PASSWORD= docker-compose up -d -.. note:: - - This will be a persisted using ~/.postgresql/data - -.. code-block:: sh - - mkdir ~/.postgresql/data - docker run -e POSTGRES_PASSWORD=pass -p 5432:5432 --volume ~/.postgresql/data:/var/lib/postgresql/data --name onadata -d postgres:9.6.1 - -Connect using psql with: +Connect to postgres using psql with: .. code-block:: sh psql -h localhost -p 5432 -U postgres -In psql: - -.. code-block:: sql - CREATE USER WITH PASSWORD '' SUPERUSER CREATEDB LOGIN; - CREATE DATABASE WITH ENCODING='UTF8' LC_CTYPE='en_US.UTF-8' LC_COLLATE='en_US.UTF-8' OWNER= TEMPLATE=template0; - CONNECT ; - CREATE EXTENSION IF NOT EXISTS postgis; - CREATE EXTENSION IF NOT EXISTS postgis_topology; +From now onwards start the onadata database with ``docker start onadata-postgres`` -From now onwards start your DB with ``docker start onadata`` provided you passed -the name "onadata" to Docker's ``--name`` option. +You can then initialize the users and database as explained above. Get the code ------------