mirror of
http://junepve.top:3000/chicrobot/README.git
synced 2026-10-29 17:47:34 +08:00
添加 c10_docker运行trilium.md
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# docker运行trilium
|
||||
笔记
|
||||
## 获取镜像
|
||||
```
|
||||
sudo docker pull swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/triliumnext/trilium:v0.99.5
|
||||
sudo docker tag swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/triliumnext/trilium:v0.99.5 docker.io/triliumnext/trilium:v0.99.5
|
||||
sudo docker rmi swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/triliumnext/trilium:v0.99.5
|
||||
```
|
||||
|
||||
|
||||
## 启动镜像
|
||||
启动容器
|
||||
```
|
||||
sudo docker run -d \
|
||||
--name trilium \
|
||||
-p 127.0.0.1:8092:8080 \
|
||||
-v ~/trilium-data:/home/node/trilium-data \
|
||||
triliumnext/trilium:v0.99.5
|
||||
```
|
||||
|
||||
## nginx
|
||||
```
|
||||
# 反向代理
|
||||
location /trilium/ {
|
||||
proxy_pass http://127.0.0.1:8092/;
|
||||
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;
|
||||
|
||||
# 👇 关键:WebSocket 支持
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
```
|
||||
```
|
||||
docker exec nginx nginx -s reload
|
||||
```
|
||||
Reference in New Issue
Block a user