Update Docker samples

This commit is contained in:
Neil Alexander 2020-10-13 09:50:11 +01:00
parent 8001627cfc
commit 2f578531ba
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
3 changed files with 24 additions and 7 deletions

View file

@ -38,21 +38,38 @@ go run github.com/matrix-org/dendrite/cmd/generate-keys \
--tls-key=server.key --tls-key=server.key
``` ```
## Starting Dendrite ## Starting Dendrite as a monolith deployment
Once in place, start the dependencies: Create your config based on the `dendrite.yaml` configuration file in the `docker/config`
folder in the [Dendrite repository](https://github.com/matrix-org/dendrite). Additionally,
make the following changes to the configuration:
- Enable Naffka: `use_naffka: true`
Once in place, start the PostgreSQL dependency:
``` ```
docker-compose -f docker-compose.deps.yml up docker-compose -f docker-compose.deps.yml up postgres
``` ```
Wait a few seconds for Kafka and Postgres to finish starting up, and then start a monolith: Wait a few seconds for PostgreSQL to finish starting up, and then start a monolith:
``` ```
docker-compose -f docker-compose.monolith.yml up docker-compose -f docker-compose.monolith.yml up
``` ```
... or start the polylith components: ## Starting Dendrite as a polylith deployment
Create your config based on the `dendrite.yaml` configuration file in the `docker/config`
folder in the [Dendrite repository](https://github.com/matrix-org/dendrite).
Once in place, start all the dependencies:
```
docker-compose -f docker-compose.deps.yml up
```
Wait a few seconds for PostgreSQL and Kafka to finish starting up, and then start a polylith:
``` ```
docker-compose -f docker-compose.polylith.yml up docker-compose -f docker-compose.polylith.yml up

View file

@ -76,7 +76,7 @@ global:
# Naffka database options. Not required when using Kafka. # Naffka database options. Not required when using Kafka.
naffka_database: naffka_database:
connection_string: file:naffka.db connection_string: postgresql://dendrite:itsasecret@postgres/dendrite_naffka?sslmode=disable
max_open_conns: 100 max_open_conns: 100
max_idle_conns: 2 max_idle_conns: 2
conn_max_lifetime: -1 conn_max_lifetime: -1

2
build/docker/postgres/create_db.sh Normal file → Executable file
View file

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
for db in account device mediaapi syncapi roomserver signingkeyserver keyserver federationsender appservice e2ekey naffka; do for db in account device mediaapi syncapi roomserver signingkeyserver keyserver federationsender appservice e2ekey naffka; do
createdb -U dendrite -O dendrite dendrite_$db createdb -U dendrite -O dendrite dendrite_$db