部署日期:2026-08-05 | 与 LobeHub 共用 Postgres
https://suyushi.top → LobeHub (Nginx → :3210)
https://wiki.suyushi.top → Wiki.js (Nginx → :3000)
https://git.suyushi.top → Gitea (Nginx → :3001)
三服务共用同一个 Postgres 实例(lobe-postgres 容器),各自独立数据库。
docker run -d --name wikijs --network lobehub_lobe-network \
--restart unless-stopped -p 3000:3000 \
-e DB_TYPE=postgres -e DB_HOST=postgresql -e DB_PORT=5432 \
-e DB_USER=postgres -e DB_PASS="\$DB_PASS" -e DB_NAME=wiki \
ghcr.io/requarks/wiki:2
wikidocker compose exec postgresql psql -U postgres -c 'CREATE DATABASE wiki;'server {
listen 80;
server_name wiki.suyushi.top;
location / {
proxy_pass http://127.0.0.1:3000;
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;
}
}
certbot --nginx -d wiki.suyushi.top --non-interactive --agree-tos \
--email panghusys2025@gmail.com --redirect
docker run -d --name gitea --network lobehub_lobe-network \
--restart unless-stopped -p 3001:3000 -p 2222:22 \
-e GITEA__database__DB_TYPE=postgres \
-e GITEA__database__HOST=postgresql:5432 \
-e GITEA__database__NAME=gitea \
-e GITEA__database__USER=postgres \
-e GITEA__database__PASSWD="\$DB_PASS" \
-e GITEA__server__DOMAIN=git.suyushi.top \
-e GITEA__server__ROOT_URL=https://git.suyushi.top \
-e GITEA__server__SSH_DOMAIN=git.suyushi.top \
-e GITEA__server__SSH_PORT=2222 \
-e GITEA__service__DISABLE_REGISTRATION=true \
-v /lobehub/gitea:/data \
gitea/gitea:latest
giteadocker compose exec postgresql psql -U postgres -c 'CREATE DATABASE gitea;'server {
listen 80;
server_name git.suyushi.top;
client_max_body_size 100M;
location / {
proxy_pass http://127.0.0.1:3001;
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;
}
}
certbot --nginx -d git.suyushi.top --non-interactive --agree-tos \
--email panghusys2025@gmail.com --redirect
git clone ssh://git@git.suyushi.top:2222/用户名/仓库名.git
| 项目 | 注意 |
|---|---|
| 容器网络 | 三服务都在 lobehub_lobe-network,通过容器名互访 |
| Nginx 配置 | /etc/nginx/conf.d/ 下各自独立 conf |
| 端口映射 | 3000/3001/3210 只对内,Nginx 对外 |
| DNS 子域名 | Namesilo API 调不通时从服务器 curl 调用 |
| Let's Encrypt | 子域名验证需 A 记录,不用 CNAME |