New services: - animaltrack.hcl: Python app with health checks and auto_revert - act-runner.hcl: Gitea Actions runner on Nomad New infrastructure: - nix-runner/: Custom Nix Docker image for CI with modern Nix, local cache (c3), and bundled tools (skopeo, jq, etc.) Modified: - gitea.hcl: Enable Gitea Actions The CI workflow (in animaltrack repo) builds Docker images with Nix, pushes to Gitea registry, and triggers Nomad deployments with automatic rollback on health check failure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
80 lines
1.9 KiB
HCL
80 lines
1.9 KiB
HCL
job "gitea" {
|
|
datacenters = ["alo"]
|
|
|
|
meta {
|
|
uuid = uuidv4()
|
|
}
|
|
|
|
group "web" {
|
|
network {
|
|
port "http" {
|
|
to = 3000
|
|
}
|
|
port "ssh" {
|
|
to = 2222
|
|
}
|
|
}
|
|
|
|
task "server" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
# TODO: revert to latest once 1.25.1+ is released
|
|
#image = "gitea/gitea:latest-rootless"
|
|
image = "gitea/gitea:1.25-nightly-rootless"
|
|
ports = [
|
|
"http",
|
|
"ssh",
|
|
]
|
|
volumes = [
|
|
"/data/services/gitea/data:/var/lib/gitea",
|
|
"/data/services/gitea/config:/etc/gitea",
|
|
"/etc/timezone:/etc/timezone:ro",
|
|
"/etc/localtime:/etc/localtime:ro",
|
|
]
|
|
}
|
|
|
|
env {
|
|
GITEA__database__DB_TYPE = "postgres"
|
|
GITEA__database__HOST = "postgres.service.consul:5432"
|
|
GITEA__database__NAME = "gitea"
|
|
GITEA__database__USER = "gitea"
|
|
GITEA__database__PASSWD = "thu3AhkeisoohaeXuKee"
|
|
GITEA__mailer__ENABLED = "true"
|
|
GITEA__mailer__FROM = "gitea@paler.net"
|
|
GITEA__mailer__PROTOCOL = "smtp"
|
|
GITEA__mailer__SMTP_ADDR = "192.168.1.1"
|
|
GITEA__actions__ENABLED = "true"
|
|
GITEA__actions__DEFAULT_ACTIONS_URL = "https://gitea.com"
|
|
}
|
|
|
|
service {
|
|
name = "gitea"
|
|
port = "http"
|
|
|
|
tags = [
|
|
"traefik.enable=true",
|
|
"traefik.http.routers.gitea.entryPoints=websecure",
|
|
"traefik.http.services.gitea.loadBalancer.serversTransport=gitea-transport@file",
|
|
]
|
|
}
|
|
|
|
service {
|
|
name = "gitea-ssh"
|
|
port = "ssh"
|
|
|
|
tags = [
|
|
"traefik.enable=true",
|
|
"traefik.tcp.routers.gitea-ssh.rule=HostSNI(`*`)",
|
|
"traefik.tcp.routers.gitea-ssh.entryPoints=ssh",
|
|
"traefik.tcp.routers.gitea-ssh.service=gitea-ssh",
|
|
]
|
|
}
|
|
|
|
resources {
|
|
memory = 500
|
|
}
|
|
}
|
|
}
|
|
}
|