Add Redis for Caching (no persistance)

This commit is contained in:
2024-02-06 13:02:51 -08:00
parent ffe8c8fecd
commit 1b9c244cb0
2 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
job "redis-cache" {
datacenters = ["dc1"]
group "cache" {
count = 1
network {
mode = "bridge"
port "redis" {
to = 6379
}
}
service {
# Make available to other services by the 'redis-cache' name
name = "redis-cache"
port = "6379"
tags = ["traefik.enable=false"] # Hide redis from traefik
# Make available through the consul service mesh
connect {
sidecar_service {
tags = ["traefik.enable=false"] # Hide redis envoy from traefik
}
}
}
task "redis" {
driver = "docker"
config {
image = "redis:7.2.3-alpine"
ports = ["redis"]
}
}
}
}