Docker compose example (#9679)

* Adds working docker-compose example

* Adds timezone to docker-compose example
This commit is contained in:
Kieran Wynne 2023-11-18 02:38:22 +00:00 committed by GitHub
parent af2fd13ae1
commit 007ed6c4e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.