Pushing straight to GitHub from KZ is a lottery — TCP to github.com times out often enough that git push becomes a flake. Fix: Forgejo runs on the stage server (sqlite, single container), all pushes go there first (local network, always reliable), a systemd timer mirrors the whole repo into GitHub every 10 minutes so GitHub stays up-to-date as a backup + CI source. What's committed here is the infra-as-code side: - deploy/forgejo/docker-compose.yml — Forgejo 7 on :3000 (HTTP) and :2222 (SSH) - deploy/forgejo/food-market-forgejo.service — systemd unit that drives compose - deploy/forgejo/mirror-to-github.sh + mirror timer/service — push to GH every 10 min - deploy/forgejo/nginx.conf — vhost for git.zat.kz (certbot to be run once DNS is set) - docs/forgejo.md — how to clone/push, operations, what's left for the user (DNS + certbot) GitHub Actions CI is untouched: commits land on GitHub via the mirror and the self-hosted runner picks them up as before. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28 lines
1 KiB
YAML
28 lines
1 KiB
YAML
services:
|
|
forgejo:
|
|
image: codeberg.org/forgejo/forgejo:7
|
|
container_name: food-market-forgejo
|
|
restart: unless-stopped
|
|
environment:
|
|
USER_UID: "1000"
|
|
USER_GID: "1000"
|
|
FORGEJO__server__DOMAIN: git.zat.kz
|
|
FORGEJO__server__ROOT_URL: https://git.zat.kz/
|
|
FORGEJO__server__SSH_DOMAIN: git.zat.kz
|
|
FORGEJO__server__SSH_PORT: "2222"
|
|
FORGEJO__server__SSH_LISTEN_PORT: "22"
|
|
FORGEJO__server__START_SSH_SERVER: "false"
|
|
FORGEJO__server__DISABLE_SSH: "false"
|
|
FORGEJO__service__DISABLE_REGISTRATION: "true"
|
|
FORGEJO__service__REQUIRE_SIGNIN_VIEW: "false"
|
|
FORGEJO__actions__ENABLED: "true"
|
|
FORGEJO__database__DB_TYPE: sqlite3
|
|
FORGEJO__log__LEVEL: Info
|
|
volumes:
|
|
- /opt/food-market-data/forgejo/data:/data
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
ports:
|
|
- "127.0.0.1:3000:3000" # HTTP, fronted by nginx on git.zat.kz
|
|
- "2222:22" # SSH for git clone/push via ssh://git@git.zat.kz:2222/...
|