add dcusr listmonk job
This commit is contained in:
		
							parent
							
								
									33b05a1d3e
								
							
						
					
					
						commit
						16a7dd42aa
					
				
					 1 changed files with 109 additions and 0 deletions
				
			
		
							
								
								
									
										109
									
								
								jobs/socs/dcusr-listmonk.hcl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										109
									
								
								jobs/socs/dcusr-listmonk.hcl
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,109 @@
 | 
				
			||||||
 | 
					job "dcusr-listmonk" {
 | 
				
			||||||
 | 
					  datacenters = ["aperture"]
 | 
				
			||||||
 | 
					  type        = "service"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  meta {
 | 
				
			||||||
 | 
					    domain = "lists.solarracing.ie"
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  group "listmonk" {
 | 
				
			||||||
 | 
					    network {
 | 
				
			||||||
 | 
					      # mode = "bridge"
 | 
				
			||||||
 | 
					      port "http" {
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      port "db" {
 | 
				
			||||||
 | 
					        to = 5432
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    service {
 | 
				
			||||||
 | 
					      name = "listmonk"
 | 
				
			||||||
 | 
					      port = "http"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      #check {
 | 
				
			||||||
 | 
					      #  type     = "http"
 | 
				
			||||||
 | 
					      #  path     = "/"
 | 
				
			||||||
 | 
					      #  interval = "10s"
 | 
				
			||||||
 | 
					      #  timeout  = "2s"
 | 
				
			||||||
 | 
					      #}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      tags = [
 | 
				
			||||||
 | 
					        "traefik.enable=true",
 | 
				
			||||||
 | 
					        "traefik.port=${NOMAD_PORT_http}",
 | 
				
			||||||
 | 
					        "traefik.http.routers.dcusr-listmonk.entrypoints=web,websecure",
 | 
				
			||||||
 | 
					        "traefik.http.routers.dcusr-listmonk.rule=Host(`${NOMAD_META_domain}`)",
 | 
				
			||||||
 | 
					        "traefik.http.routers.dcusr-listmonk.tls=true",
 | 
				
			||||||
 | 
					        "traefik.http.routers.dcusr-listmonk.tls.certresolver=lets-encrypt",
 | 
				
			||||||
 | 
					      ]
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    task "app" {
 | 
				
			||||||
 | 
					      driver = "docker"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      config {
 | 
				
			||||||
 | 
					        image = "listmonk/listmonk:latest"
 | 
				
			||||||
 | 
					        ports = ["http"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #entrypoint = ["sh", "-c", "sleep 1000000"]
 | 
				
			||||||
 | 
					        entrypoint = ["./listmonk", "--static-dir=/listmonk/static"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        volumes = [
 | 
				
			||||||
 | 
					          "/storage/nomad/dcusr-listmonk/static:/listmonk/static",
 | 
				
			||||||
 | 
					          "/storage/nomad/dcusr-listmonk/postgres/:/var/lib/postgresql/data",
 | 
				
			||||||
 | 
					          "local/config.toml:/listmonk/config.toml"
 | 
				
			||||||
 | 
					        ]
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      resources {
 | 
				
			||||||
 | 
					        cpu    = 1000
 | 
				
			||||||
 | 
					        memory = 500
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      template {
 | 
				
			||||||
 | 
					        data        = <<EOH
 | 
				
			||||||
 | 
					[app]
 | 
				
			||||||
 | 
					address = "0.0.0.0:{{ env "NOMAD_PORT_http" }}"
 | 
				
			||||||
 | 
					admin_username = "{{ key "dcusr/listmonk/admin/username" }}"
 | 
				
			||||||
 | 
					admin_password = "{{ key "dcusr/listmonk/admin/password" }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Database.
 | 
				
			||||||
 | 
					[db]
 | 
				
			||||||
 | 
					host = "{{ env "NOMAD_HOST_IP_db" }}"
 | 
				
			||||||
 | 
					port = {{ env "NOMAD_HOST_PORT_db" }}
 | 
				
			||||||
 | 
					user = "{{ key "dcusr/listmonk/db/username" }}"
 | 
				
			||||||
 | 
					password = "{{ key "dcusr/listmonk/db/password" }}"
 | 
				
			||||||
 | 
					database = "{{ key "dcusr/listmonk/db/name" }}"
 | 
				
			||||||
 | 
					ssl_mode = "disable"
 | 
				
			||||||
 | 
					max_open = 25
 | 
				
			||||||
 | 
					max_idle = 25
 | 
				
			||||||
 | 
					max_lifetime = "300s"
 | 
				
			||||||
 | 
					EOH
 | 
				
			||||||
 | 
					        destination = "local/config.toml"
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    task "dcusr-listmonk-db" {
 | 
				
			||||||
 | 
					      driver = "docker"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      config {
 | 
				
			||||||
 | 
					        image = "postgres:17-alpine"
 | 
				
			||||||
 | 
					        ports = ["db"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        volumes = [
 | 
				
			||||||
 | 
					          "/storage/nomad/dcusr-listmonk/postgres:/var/lib/postgresql/data"
 | 
				
			||||||
 | 
					        ]
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      template {
 | 
				
			||||||
 | 
					        data        = <<EOH
 | 
				
			||||||
 | 
					POSTGRES_DB       = "{{ key "dcusr/listmonk/db/name" }}"
 | 
				
			||||||
 | 
					POSTGRES_USER     = "{{ key "dcusr/listmonk/db/username" }}"
 | 
				
			||||||
 | 
					POSTGRES_PASSWORD = "{{ key "dcusr/listmonk/db/password" }}"
 | 
				
			||||||
 | 
					EOH
 | 
				
			||||||
 | 
					        destination = "local/db.env"
 | 
				
			||||||
 | 
					        env         = true
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in a new issue