From a16fd67b51c02e09ef6709bee9ad2b341d80cd73 Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Thu, 13 Apr 2023 04:41:43 -0500 Subject: [PATCH] docs: add docs for installing with sqlite in docker (#70) Co-authored-by: kolaente Reviewed-On: https://github.com/go-vikunja/api/pull/70 --- docs/content/doc/setup/full-docker-example.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/content/doc/setup/full-docker-example.md b/docs/content/doc/setup/full-docker-example.md index 755983b3a..23333931d 100644 --- a/docs/content/doc/setup/full-docker-example.md +++ b/docs/content/doc/setup/full-docker-example.md @@ -68,6 +68,37 @@ You'll also need to change the `VIKUNJA_DATABASE_TYPE` to `postgres` on the api NOTE: 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. +## Sqlite + +Vikunja supports postgres, mysql and sqlite as a database backend. The examples on this page use mysql with a mariadb container. +To use sqlite as a database backend, change the `api` section of the examples to this: + +{{< highlight yaml >}} +api: + image: vikunja/api + environment: + VIKUNJA_SERVICE_JWTSECRET: + VIKUNJA_SERVICE_FRONTENDURL: http:/// + # Note the default path is /app/vikunja/vikunja.db This moves to a different folder so you can use a volume and store this outside of the container so state is persisted even if container destroyed. + VIKUNJA_DATABASE_PATH: /db/vikunja.db + ports: + - 3456:3456 + volumes: + - ./files:/app/vikunja/files + - ./db:/db + restart: unless-stopped +{{< /highlight >}} + +The default path Vikunja uses for sqlite is relative to the binary, which in the docker container would be `/app/vikunja/vikunja.db`. This config moves to a different folder using `VIKUNJA_DATABASE_PATH` so you can use a volume at `/db` and store this outside of the container so state is persisted even if container destroyed. + +You'll also need to remove or change the `VIKUNJA_DATABASE_TYPE` to `sqlite` on the api container declaration. + +You can also remove the db section. + +
+NOTE: If you'll use your instance with more than a handful of users, we recommend using mysql or postgres. +
+ ## Example without any proxy This example lets you host Vikunja without any reverse proxy in front of it. This is the absolute minimum configuration you need to get something up and running. If you want to host Vikunja on one single port instead of two different ones or need tls termination, check out one of the other examples.