使用 docker compose.yml
version: "3.9"
services:
main:
image: b3log/siyuan
command: ['--workspace=/siyuan/workspace/', '--accessAuthCode=xxxxxxxxx']
user: '1000:1000'
ports:
- 6806:6806
volumes:
- /data/siyuan/data:/siyuan/workspace
restart: always
environment:
- TZ=Asia/Shanghai
docker compose up -d
docker compose restart
对目录进行赋权
chown -R 1000:1000 /data/siyuan/data
TIP:nginx需要配置/ws websocket代理
server {
listen 80;
server_name note.skyner.cn;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name note.skyner.cn;
ssl_certificate /etc/nginx/cert/star.skyner.cn_cert.pem;
ssl_certificate_key /etc/nginx/cert/star.skyner.cn_key.key;
location / {
proxy_pass http://localhost:6806;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /ws {
proxy_pass http://localhost:6806/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
原文参考:https://github.com/siyuan-note/siyuan/blob/master/README_zh_CN.md