From 78cae80fcc1329cfae749560f7bcbcce0cffe46e Mon Sep 17 00:00:00 2001
From: L4168 <L4168@student.jamk.fi>
Date: Thu, 6 Jun 2019 18:46:41 +0300
Subject: [PATCH] updated readme instructions

---
 README.md | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 027c7d6..939b18f 100644
--- a/README.md
+++ b/README.md
@@ -38,10 +38,37 @@ Name .env.example to .env and ormconfig.json.example to ormconfig.json and add v
 
 **.env names are case sensitive!**
 
-Needed postgresql modules:
+**Configuring a database with Docker for this application:**
+
 ```bash
-# Inside the database that you're connecting to:
-CREATE EXTENSION "uuid-ossp";
+# first run
+docker run --name postgis -p 5432:5432 -d -v /home/postgres:/var/lib/postgresql/data mdillon/postgis
+# stopping the container
+docker stop postgis
+# starting the container
+docker start postgis
+# you can also have the container boot on computer startup with --restart option
+--restart=always
+# for example:
+docker run --name postgis -p 5432:5432 -d -v /home/postgres:/var/lib/postgresql/data --restart=always mdillon/postgis
+# starting bash inside the container
+docker exec -it postgis bash
+# connecting to the postgis service inside docker
+psql -U postgres
+# Inside the database:
+# Creating database
+create database ehasa;
+# Connect to created database
+\c ehasa;
+# Create user for database
+create user ehasa
+alter user ehasa with encrypted password 'salasana';
+# Give privileges to use database
+grant all privileges on database ehasa to ehasa;
+# Needed extensions
+create extension "uuid-ossp";
+# exit postgis
+\q
 ```
 ## Running the app
 
-- 
GitLab