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" {
|
||||
group "app" {
|
||||
task "lifefaq" {
|
||||
region = "global"
|
||||
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"
|
||||
|
||||
config {
|
||||
image = "registry.i80.dk/gitea/lifefaq:latest"
|
||||
ports = ["port-app"]
|
||||
}
|
||||
|
||||
env {
|
||||
APP_ENV = "production"
|
||||
PORT = "${NOMAD_PORT_port-app}"
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 500
|
||||
memory = 256
|
||||
cpu = 250
|
||||
memory = 80
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ job "lifefaq" {
|
||||
|
||||
network {
|
||||
port "port-app" {
|
||||
to = 9210 # Internal application port
|
||||
to = 0 # Internal application port
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,7 @@ job "lifefaq" {
|
||||
}
|
||||
|
||||
env {
|
||||
APP_ENV = "production"
|
||||
PORT = "${NOMAD_PORT_port-app}"
|
||||
APP_ENV = "production" PORT = "${NOMAD_PORT_port-app}"
|
||||
}
|
||||
|
||||
resources {
|
||||
|
||||
@@ -14,7 +14,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY . .
|
||||
|
||||
# Expose the port the FastAPI app runs on (default Uvicorn port)
|
||||
EXPOSE 9210
|
||||
EXPOSE 9212
|
||||
|
||||
# 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