deploy: 适配现有 Caddy 配置(gitea 域名路径反代 + 共享网络)

This commit is contained in:
root
2026-10-16 11:33:13 +08:00
parent 2660dc6fa9
commit 5b48fadc46
2 changed files with 39 additions and 27 deletions
+28 -10
View File
@@ -1,12 +1,30 @@
# 方式一:独立子域名(DNS 添加 sync.linyux.cn A 记录后使用) gitea.linyux.cn {
sync.linyux.cn { handle_path /sync-api/* {
reverse_proxy 127.0.0.1:3780 reverse_proxy internlog-sync:3780
}
handle {
reverse_proxy gitea:3000
}
} }
# 方式二:复用现有域名路径(并入 gitea.linyux.cn 的站点块,不要单独建站) img.linyux.cn {
# gitea.linyux.cn { reverse_proxy lsky:8089
# handle_path /sync-api/* { }
# reverse_proxy 127.0.0.1:3780
# } halo.linyux.cn, www.linyux.cn {
# # ...原有 Gitea 反代配置 root * /www
# } @static {
path /BingSiteAuth.xml
}
handle @static {
root * /www
file_server
}
handle {
reverse_proxy halo:8090
}
}
umami.linyux.cn {
reverse_proxy umami:3000
}
+11 -17
View File
@@ -2,23 +2,17 @@ services:
internlog-sync: internlog-sync:
build: . build: .
container_name: internlog-sync container_name: internlog-sync
ports: restart: unless-stopped
- "3780:3780"
volumes: volumes:
- ./data:/app/data - ./data:/app/data
restart: unless-stopped networks:
- proxy-net
# 可选:Caddy 自动 HTTPS。若宿主机已有 Caddy/nginx 占用 80/443,请改用 # 让 Caddy 能用容器名 internlog-sync 直接访问本服务。
# 现有反代添加站点块(见 DEPLOY.md),不要启用本段。 # 请先查出 Caddy 与 gitea 所在的共享网络名:
# # docker inspect gitea --format '{{range $k,$v := .NetworkSettings.Networks}}{{$k}} {{end}}'
# caddy: # 把下面 name 替换成查到的网络名。若 Caddy 与本服务同属一个 compose 项目则可删掉 networks 配置。
# image: caddy:2-alpine networks:
# container_name: internlog-caddy proxy-net:
# ports: name: proxy-net
# - "80:80" external: true
# - "443:443"
# volumes:
# - ./Caddyfile:/etc/caddy/Caddyfile:ro
# - ./caddy_data:/data
# - ./caddy_config:/config
# restart: unless-stopped