源文地址:https://skyner.cn/archives/docker-deploy-siyuan-note-service-si2fb
使用 docker compose.yml
1 2 3 4 5 6 7 8 9 10 11 12 13
| 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
|
1 2
| docker compose up -d docker compose restart
|
对目录进行赋权
1
| chown -R 1000:1000 /data/siyuan/data
|
TIP:nginx需要配置/ws websocket代理
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| 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
Author:
Shenhuanjie
Permalink:
http://shenhuanjie.github.io/post/docker-deploy-siyuan-note-service-si2fb.html
License:
Copyright (c) 2024 CC-BY-NC-4.0 LICENSE
Slogan:
Do you believe in DESTINY?