diff --git a/README.md b/README.md index 027c7d686d0517a99a0764f050b1ab15bfff2f88..939b18f301e2cf4327798e4236475b283b093f3a 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