Files
jiu/deploy/runner/docker-compose.forgejo.yml
wangjia b243ad885f chore(deploy): 更新 NAS 部署配置和本地部署脚本
- docker-compose: 切换为 gitea/gitea 镜像,修正备份挂载路径
- scripts/deploy.sh: 新增本地一键部署脚本(测试→编译→发版→部署)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 02:30:03 +08:00

52 lines
1.8 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.
# 群晖 NAS 自托管 Forgejo + act_runner
#
# 使用方法:
# 1. 在同目录创建 .env(不要提交到 git),填入以下变量:
# FORGEJO_ROOT_URL=http://192.168.1.x:3000
# NAS_IP=192.168.1.x
# RUNNER_TOKEN=(第5步获取)
# 2. 将 act-runner-config.yaml 复制到 NAS
# /volume1/docker/forgejo/runner/config.yaml
# 3. Container Manager 导入此文件并启动(或 docker compose up -d
# 4. 浏览器访问 http://NAS-IP:3000 完成 Forgejo 初始化(创建管理员账号)
# 5. 站点管理 → 配置 → 开启 Actions
# 仓库 Settings → Actions → Runners → 获取注册 Token → 填入 .env RUNNER_TOKEN
# 6. 重启 act-runner 容器完成 Runner 注册
#
# 本地访问:http://NAS-IP:3000
# Git SSH ssh://git@NAS-IP:2222/用户名/jiu.git
services:
forgejo:
image: gitea/gitea:latest
container_name: forgejo
restart: always
environment:
USER_UID: 1000
USER_GID: 1000
GITEA__actions__ENABLED: "true"
GITEA__server__ROOT_URL: ${FORGEJO_ROOT_URL:-http://localhost:3000}
GITEA__server__SSH_DOMAIN: ${NAS_IP:-localhost}
GITEA__server__SSH_PORT: 2222
ports:
- "3000:3000"
- "2222:22"
volumes:
- /volume1/docker/forgejo/data:/data
act-runner:
image: gitea/act_runner:latest # Forgejo 兼容 Gitea act_runner
container_name: forgejo-act-runner
restart: always
depends_on:
- forgejo
environment:
CONFIG_FILE: /data/config.yaml
GITEA_INSTANCE_URL: http://forgejo:3000 # Docker 内部通信
GITEA_RUNNER_REGISTRATION_TOKEN: ${RUNNER_TOKEN}
GITEA_RUNNER_NAME: nas-runner
volumes:
- /volume1/docker/forgejo/runner:/data
- /var/run/docker.sock:/var/run/docker.sock
- /volume1/docker/backups:/volume1/docker/backups