docs: add postgres to docker-compose examples

This commit is contained in:
kolaente 2021-11-13 18:08:57 +01:00
parent 4829c89940
commit 2aea1691cf
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -25,6 +25,9 @@ All examples on this page already reflect this and do not require additional wor
## Redis ## Redis
While Vikunja has support to use redis as a caching backend, you'll probably not need it unless you're using Vikunja
with more than a handful of users.
To use redis, you'll need to add this to the config examples below: To use redis, you'll need to add this to the config examples below:
{{< highlight yaml >}} {{< highlight yaml >}}
@ -44,6 +47,29 @@ services:
image: redis image: redis
{{< /highlight >}} {{< /highlight >}}
## PostgreSQL
Vikunja supports postgres, mysql and sqlite as a database backend. The examples on this page use mysql with a mariadb container.
To use postgres as a database backend, change the `db` section of the examples to this:
{{< highlight yaml >}}
db:
image: postgres:13
environment:
POSTGRES_PASSWORD: secret
POSTGRES_USER: vikunja
volumes:
- ./db:/var/lib/postgresql/data
restart: unless-stopped
{{< /highlight >}}
You'll also need to change the `VIKUNJA_DATABASE_TYPE` to `postgres` on the api container declaration.
<div class="notification is-warning">
<b>NOTE:</b> The mariadb container can sometimes take a while to initialize, especially on the first run.
During this time, the api container will fail to start at all. It will automatically restart every few seconds.
</div>
## Example without any proxy ## Example without any proxy
This example lets you host Vikunja without any reverse proxy in front of it. This is the absolute minimum configuration This example lets you host Vikunja without any reverse proxy in front of it. This is the absolute minimum configuration