From 007ed6c4e621e8e606f3e7627bbbedeaf56ca766 Mon Sep 17 00:00:00 2001 From: Kieran Wynne Date: Sat, 18 Nov 2023 02:38:22 +0000 Subject: [PATCH] Docker compose example (#9679) * Adds working docker-compose example * Adds timezone to docker-compose example --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 6b89e41f0..149445b16 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,24 @@ To simplify, it is recommended to configure the workspace folder path to be cons docker run -d -v /siyuan/workspace:/siyuan/workspace -p 6806:6806 -u 1000:1000 b3log/siyuan --workspace=/siyuan/workspace/ --accessAuthCode=xxx ``` +Alternatively, see below for an example docker-compose file: +``` +version: "3.9" +services: + main: + image: b3log/siyuan + command: ['--workspace=/siyuan/workspace/','--accessAuthCode=${AuthCode}'] + user: '1000:1000' + ports: + - 6806:6806 + volumes: + - /siyuan/workspace:/siyuan/workspace + restart: unless-stopped + environment: + # A list of time zone identifiers can be found at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + - TZ=${TimeZone} +``` + #### User permissions In the image, the normal user `siyuan` (uid 1000/gid 1000) created by default is used to start the kernel process. Therefore, when the host creates a workspace folder, please pay attention to setting the user group of the folder: `chown -R 1000:1000 /siyuan/workspace`. The parameter `-u 1000:1000` is required when starting the container.