generated from hjess/PythonTemplateProject
Blue Green
Some checks failed
Build, Push, and Blue/Green Deploy to Nomad / docker-nomad (push) Failing after 7s
Some checks failed
Build, Push, and Blue/Green Deploy to Nomad / docker-nomad (push) Failing after 7s
This commit is contained in:
@@ -1,15 +1,59 @@
|
|||||||
job "lifefaq-blue" {
|
job "lifefaq-blue" {
|
||||||
group "app" {
|
region = "global"
|
||||||
task "lifefaq" {
|
datacenters = ["dc1"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
update {
|
||||||
|
stagger = "60s"
|
||||||
|
max_parallel = 1
|
||||||
|
progress_deadline = "6m"
|
||||||
|
}
|
||||||
|
|
||||||
|
group "lifefaq-blue-group" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "port-app" {
|
||||||
|
to = 9212 # Internal application port
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Register the service with Consul
|
||||||
|
service {
|
||||||
|
provider = "consul"
|
||||||
|
name = "lifefaq-blue"
|
||||||
|
port = "port-app"
|
||||||
|
|
||||||
|
# Traefik-specific tags for routing
|
||||||
|
tags = [
|
||||||
|
"PORT=${NOMAD_PORT_port-app}"
|
||||||
|
]
|
||||||
|
|
||||||
|
# Define a health check using TCP
|
||||||
|
check {
|
||||||
|
name = "tcp_check"
|
||||||
|
type = "tcp"
|
||||||
|
interval = "10s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "lifefaq-blue-task" {
|
||||||
driver = "docker"
|
driver = "docker"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "registry.i80.dk/gitea/lifefaq:latest"
|
image = "registry.i80.dk/gitea/lifefaq:latest"
|
||||||
|
ports = ["port-app"]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
APP_ENV = "production"
|
||||||
|
PORT = "${NOMAD_PORT_port-app}"
|
||||||
}
|
}
|
||||||
|
|
||||||
resources {
|
resources {
|
||||||
cpu = 500
|
cpu = 250
|
||||||
memory = 256
|
memory = 80
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ job "lifefaq" {
|
|||||||
|
|
||||||
network {
|
network {
|
||||||
port "port-app" {
|
port "port-app" {
|
||||||
to = 9210 # Internal application port
|
to = 0 # Internal application port
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,8 +47,7 @@ job "lifefaq" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
env {
|
env {
|
||||||
APP_ENV = "production"
|
APP_ENV = "production" PORT = "${NOMAD_PORT_port-app}"
|
||||||
PORT = "${NOMAD_PORT_port-app}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resources {
|
resources {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Expose the port the FastAPI app runs on (default Uvicorn port)
|
# Expose the port the FastAPI app runs on (default Uvicorn port)
|
||||||
EXPOSE 9210
|
EXPOSE 9212
|
||||||
|
|
||||||
# Command to run the FastAPI application
|
# Command to run the FastAPI application
|
||||||
CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "9210", "--workers", "1"]
|
CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "9212", "--workers", "1"]
|
||||||
Reference in New Issue
Block a user