Skip to content

Commit

Permalink
🔧 updated docs (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek authored Mar 25, 2021
1 parent 98c1c45 commit b924ce7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
36 changes: 35 additions & 1 deletion docs/installing_mindwendel.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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

Expand All @@ -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" \
Expand Down

0 comments on commit b924ce7

Please sign in to comment.