mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-06 11:36:44 +03:00
3.7 KiB
3.7 KiB
LXC Container Deployment Guide
Overview
Run Gitea Mirror in an isolated LXC container, either:
- Online, on a Proxmox VE host – script pulls everything from GitHub
- Offline / LAN-only, on a developer laptop – script pushes your local checkout + Bun ZIP
1. Proxmox VE (online, recommended for prod)
Prerequisites
- Proxmox VE node with the default
vmbr0bridge - Root shell on the node
- Ubuntu 22.04 LXC template present (
pveam update && pveam download ...)
One-command install
# Community-maintained script for Proxmox VE by Tobias ([CrazyWolf13](https://github.com/CrazyWolf13))
# at [community-scripts/ProxmoxVED](https://github.com/community-scripts/ProxmoxVED)
sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/gitea-mirror-install.sh)"
What it does:
- Uses the community-maintained script from ProxmoxVED
- Installs dependencies and Bun runtime
- Clones & builds
arunavo4/gitea-mirror - Creates a systemd service and starts it
- Sets up a random
JWT_SECRETfor security
Browse to:
http://<container-ip>:4321
2. Local testing (LXD on a workstation, works offline)
Prerequisites
lxdinstalled (sudo apt install lxd;lxd init --auto)- Your repo cloned locally – e.g.
~/Development/gitea-mirror - Bun ZIP downloaded once:
https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip
Offline installer script
git clone https://github.com/arunavo4/gitea-mirror.git # if not already
curl -fsSL https://raw.githubusercontent.com/arunavo4/gitea-mirror/main/scripts/gitea-mirror-lxc-local.sh -o gitea-mirror-lxc-local.sh
chmod +x gitea-mirror-lxc-local.sh
sudo LOCAL_REPO_DIR=~/Development/gitea-mirror \
./gitea-mirror-lxc-local.sh
What it does:
- Launches privileged LXC
gitea-test(lxc launch ubuntu:22.04 ...) - Pushes Bun ZIP + tarred local repo into
/opt - Unpacks, builds, initializes DB
- Symlinks both
bunandbunx→/usr/local/bin - Creates a root systemd unit and starts it
Access from host:
http://$(lxc exec gitea-test -- hostname -I | awk '{print $1}'):4321
(Optional) forward to host localhost:
sudo lxc config device add gitea-test mirror proxy \
listen=tcp:0.0.0.0:4321 connect=tcp:127.0.0.1:4321
Health-check endpoint
Gitea Mirror includes a built-in health check endpoint at /api/health that provides:
- System status and uptime
- Database connectivity check
- Memory usage statistics
- Environment information
You can use this endpoint for monitoring your deployment:
# Basic check (returns 200 OK if healthy)
curl -I http://<container-ip>:4321/api/health
# Detailed health information (JSON)
curl http://<container-ip>:4321/api/health
Troubleshooting
| Check | Command |
|---|---|
| Service status | systemctl status gitea-mirror |
| Live logs | journalctl -u gitea-mirror -f |
| Verify Bun | bun --version && bunx --version |
| DB perms | chown -R root:root /opt/gitea-mirror/data (Proxmox) |
Connecting LXC and Docker Containers
If you need your LXC container to communicate with Docker containers:
-
On your host machine, create a bridge network:
docker network create gitea-network -
Find the bridge interface created by Docker:
ip a | grep docker # Look for something like docker0 or br-xxxxxxxx -
In Proxmox, edit the LXC container's network configuration to use this bridge.