Skip to content

Instantly share code, notes, and snippets.

@wxk6b1203
Created October 5, 2023 14:04
Show Gist options
  • Save wxk6b1203/98d7be8675b7dfd8a910ab9366fb0071 to your computer and use it in GitHub Desktop.
Save wxk6b1203/98d7be8675b7dfd8a910ab9366fb0071 to your computer and use it in GitHub Desktop.
gitea deployment nomac hcl file
job "gitea" {
datacenters = ["dc1"]
type = "service"
group "gitea" {
count = 1
volume "gitea" {
type = "host"
read_only = false
source = "gitea"
}
volume "timezone" {
type = "host"
read_only = true
source = "timezone"
}
volume "localtime" {
type = "host"
read_only = true
source = "localtime"
}
restart {
attempts = 10
interval = "5m"
delay = "25s"
mode = "delay"
}
task "gitea" {
driver = "docker"
config {
image = "gitea/gitea:1.18.5"
ports = ["web", "ssh"]
}
volume_mount {
volume = "gitea"
destination = "/data"
read_only = false
}
volume_mount {
volume = "localtime"
destination = "/etc/localtime"
read_only = true
}
volume_mount {
volume = "timezone"
destination = "/etc/timezone"
read_only = true
}
env {
USER_UID = 1000
USER_GID = 1000
}
resources {
cpu = 1200
memory = 2048
}
service {
name = "gitea"
port = "web"
tags = ["urlprefix-/gitea strip=/gitea"]
check {
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
}
network {
port "web" {
to = 3000
}
port "ssh" {
static = 222
to = 22
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment