Nomploy Nomad Packs

← All packs

forgejo v0.1.0

Dev tools

Forgejo — a self-hosted, community-governed Git forge (a Gitea fork): repositories, issues, pull requests, releases, a package registry, and CI via Forgejo Actions. Lightweight and fast. Deployed as a host-networked Nomad service using SQLite with a persistent data volume.

nomad-pack run forgejo --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- forgejo

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

1 task http 3030ssh 2223 1 volume image codeberg.org/forgejo/forgejo:latest tracks :latest image bumped today
Variables 10
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run forgejo -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "forgejo"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The Forgejo container image. Pin a tag in production.
image = "codeberg.org/forgejo/forgejo:latest"

# Host port for the web UI / API.
http_port = 3030

# Host port for Git-over-SSH.
ssh_port = 2223

# Public URL Forgejo is served at (ROOT_URL), e.g. https://git.example.com/. Empty = derive from the request.
root_url = ""

# Named volume for Forgejo data (/data): the SQLite database, repositories, and config.
data_volume = "forgejo_data"

# Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# Resources for the Forgejo task.
resources = {
    cpu    = 500
    memory = 512
  }
NameTypeDefaultDescription
job_name string
"forgejo"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"codeberg.org/forgejo/forgejo:latest"
The Forgejo container image. Pin a tag in production.
http_port number
3030
Host port for the web UI / API.
ssh_port number
2223
Host port for Git-over-SSH.
root_url string
""
Public URL Forgejo is served at (ROOT_URL), e.g. https://git.example.com/. Empty = derive from the request.
data_volume string
"forgejo_data"
Named volume for Forgejo data (/data): the SQLite database, repositories, and config.
constraints list
[]
Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 500
    memory = 512
  }
Resources for the Forgejo task.
Back up this pack

This pack stores data in one Docker named volume: forgejo_data

restic

# Run on the node hosting this pack. Point restic at your repo first:
#   export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>"
#   export RESTIC_PASSWORD="<repo-password>"
#   export AWS_ACCESS_KEY_ID=<key>  AWS_SECRET_ACCESS_KEY=<secret>
restic backup \
  /var/lib/docker/volumes/forgejo_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/forgejo_data/_data backup:<bucket>/forgejo_data

Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.

Readme

forgejo

Forgejo — a self-hosted, community-governed Git forge (a hard fork of Gitea). Repositories, issues, pull requests, releases, wikis, a package registry, and CI via Forgejo Actions — lightweight, fast, and fully in your control.

Single host-networked Nomad service using SQLite with a persistent data volume.

Deploy

nomad-pack registry add nomploy https://github.com/Nomploy/nomad-packs
nomad-pack run forgejo --registry=nomploy

Configure

Variable Default Description
http_port 3030 Web UI / API port.
ssh_port 2223 Git-over-SSH port.
root_url "" ROOT_URL — set to your real domain so clone URLs/links are correct.
data_volume forgejo_data /data — SQLite DB, repositories, config.
image codeberg.org/forgejo/forgejo:latest Container image. Pin a tag in production.
resources { cpu = 500, memory = 512 } Task resources.

Open the web UI and complete the first-run setup — the first registered user becomes the admin. Set root_url so clone URLs and links are right. Uses SQLite (great for small teams; switch to PostgreSQL via FORGEJO__database__* env for larger ones). Serves plain HTTP — front it with a reverse proxy for TLS. Pin the job to the node holding the volume with constraints.