From b924ce7738778ee392786c9d47e7e939f0b99dd0 Mon Sep 17 00:00:00 2001 From: JannikStreek Date: Thu, 25 Mar 2021 20:21:02 +0100 Subject: [PATCH] :wrench: updated docs (#102) --- README.md | 1 + docs/installing_mindwendel.md | 36 ++++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 64aba651..c3724d21 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Here's the TLDR: -p 127.0.0.1:80:4000 \ -e DATABASE_HOST="..." \ -e DATABASE_PORT="5432" \ + -e DATABASE_SSL="false" \ -e DATABASE_NAME="mindwendel_prod" \ -e DATABASE_USER="mindwendel_db_user" \ -e DATABASE_USER_PASSWORD="mindwendel_db_user_password" \ diff --git a/docs/installing_mindwendel.md b/docs/installing_mindwendel.md index dd000197..5b919632 100644 --- a/docs/installing_mindwendel.md +++ b/docs/installing_mindwendel.md @@ -38,6 +38,11 @@ When you use [docker-compose](https://docs.docker.com/compose/), you will be usi # Add the url host that points to this mindwendel installation. This is used by mindwendel to generate urls with the right host throughout the app. URL_HOST: "your_domain_to_mindwendel" + URL_PORT: 80 + + # for non local setups, ssl should be set to true! + DATABASE_SSL: "false" + MW_DEFAULT_LOCALE: en # Add a secret key base for mindwendel for encrypting the use session # NOTE: There are multiple commands you can use to generate a secret key base. Pick one command you like, e.g. `date +%s | sha256sum | base64 | head -c 64 ; echo` @@ -71,7 +76,35 @@ When you use [docker-compose](https://docs.docker.com/compose/), you will be usi docker-compose up ``` -Note: Adjust the env vars in `docker-copmose.yml`. +- To create the production database (after having created the containers via up): + + First, start the container: + ```sh + docker start mindwendel_db_1 + ``` + + Then eiher: + ```sh + docker exec -it mindwendel_db_1 createuser -rPed mindwendel_db_user --username=postgres + docker exec -it mindwendel_db_1 createdb mindwendel_prod --username=mindwendel_db_user + ``` + + Or login to the container and do it from there: + ```sh + docker exec -it mindwendel_db_1 sh + su -- postgres + psql + postgres=# CREATE USER mindwendel_db_user WITH PASSWORD 'mindwendel_db_user_password'; + postgres=# CREATE DATABASE mindwendel_prod; + postgres=# GRANT ALL PRIVILEGES ON DATABASE mindwendel_prod TO mindwendel_db_user; + \q + exit + ``` + + After that, adjust the db password in the docker compose file accordingly. + + Note: Adjust the env vars in `docker-compose.yml` according to your preferences. + ## Running on Docker @@ -83,6 +116,7 @@ If you are using Docker containers and prefer to manage your mindwendel installa -p 127.0.0.1:80:4000 \ -e DATABASE_HOST="..." \ -e DATABASE_PORT="5432" \ + -e DATABASE_SSL="false" \ -e DATABASE_NAME="mindwendel_prod" \ -e DATABASE_USER="mindwendel_db_user" \ -e DATABASE_USER_PASSWORD="mindwendel_db_user_password" \