Nomploy Nomad Packs

← All packs

gogs v0.1.0

Dev tools

Gogs — a painless, lightweight self-hosted Git service with a tiny footprint (single binary, SQLite by default): repositories, issues, pull requests, wikis and webhooks. Deployed as a single host-networked Nomad service.

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

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

1 task http 3000ssh 2222 1 volume image gogs/gogs:latest tracks :latest image bumped today
Variables 9
values.hcl

Save as values.hcl, edit, then run:

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

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

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

# The Gogs container image. Pin a tag in production.
image = "gogs/gogs:latest"

# Host port for the Gogs web UI.
http_port = 3000

# Host port for git-over-SSH. Avoid 22 (the host's own sshd); Gogs listens here and advertises it in clone URLs.
ssh_port = 2222

# Named volume for Gogs data: repositories, SQLite DB and config (/data).
data_volume = "gogs_data"

# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 300
    memory = 256
  }
NameTypeDefaultDescription
job_name string
"gogs"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"gogs/gogs:latest"
The Gogs container image. Pin a tag in production.
http_port number
3000
Host port for the Gogs web UI.
ssh_port number
2222
Host port for git-over-SSH. Avoid 22 (the host's own sshd); Gogs listens here and advertises it in clone URLs.
data_volume string
"gogs_data"
Named volume for Gogs data: repositories, SQLite DB and config (/data).
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 300
    memory = 256
  }
The task resources.
Back up this pack

This pack stores data in one Docker named volume: gogs_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/gogs_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/gogs_data/_data backup:<bucket>/gogs_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

gogs

Gogs is a painless, self-hosted Git service designed to be lightweight — it runs as a single binary with a tiny memory footprint and uses SQLite by default, so it's happy on the smallest hardware. It offers repositories, issues, pull requests, wikis, webhooks, and a clean web UI.

This pack runs Gogs as a single host-networked Nomad service.

Deploy

nomad-pack run gogs --registry=nomploy

Open http://<node-ip>:3000 and complete the one-time install form (the SQLite defaults work as-is), then create the admin account.

Configuration

Variable Default Description
image gogs/gogs:latest Container image (pin a tag in production).
http_port 3000 Host port for the web UI.
ssh_port 2222 Git-over-SSH port (kept off 22 / the host sshd).
data_volume gogs_data Volume for repos, SQLite DB and config (/data).
resources 300 MHz / 256 MB CPU and memory for the task.

Everything (repositories, database, config) persists in data_volume. For larger instances you can point Gogs at an external MySQL/PostgreSQL during the install step instead of SQLite.