Files
FootPrint/sync-server/docker-compose.caddy.yml

35 lines
1.7 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 与既有 Caddy 反代架构配合使用(推荐):
# 1. 把整个仓库上传到服务器(如 /opt/footprints)
# 2. Caddy 所在的 Docker 网络名已确认为 mynet(docker network ls)
# docker compose -f docker-compose.caddy.yml up -d --build
# 4. Caddyfile 增加反代块(见 README),重载 Caddy
# 5. 注册自己的账号后,把 REGISTER_ENABLED 改为 false 并重新 up -d
services:
footprints-sync:
build:
context: ..
dockerfile: sync-server/Dockerfile
container_name: footprints-sync
# 无需 ports 映射:Caddy 通过容器网络按服务名直连(footprints-sync:8788)
volumes:
- ./data:/data
- ./www:/app/www:ro # 前端直读仓库目录:git pull 即生效,无需重建镜像
- ./src:/app/src:ro # 后端源码直读(零依赖纯 .mjs)
- ./schema.sql:/app/schema.sql:ro
- ../app/server:/app/app-server:ro # 命令层整目录挂载(避免单文件嵌套遮蔽的不可靠行为)
environment:
- REGISTER_ENABLED=true
# - LSKY_API=https://img.linyux.cn/api/v1 # 兰空图床(已对接 COS):填入后附件自动直传对象存储
# - LSKY_TOKEN=1|xxxxxxxx # 兰空 个人中心 → API 接口 → 复制 Token
# - LSKY_STRATEGY_ID=2 # 存储策略 ID(2=COS 策略)
- INVITE_CODE=please-change-me # 多用户:注册须携带此邀请码(留空则不校验)
- MAX_USERS=20 # 用户数上限,0=不限
restart: unless-stopped
networks:
- proxy
networks:
proxy:
name: mynet # 服务器上已确认的 Caddy 共享网络
external: true