From fa5ce5d96917cbed0582565ec78bc67783d973be Mon Sep 17 00:00:00 2001 From: Lewis Buckley Date: Thu, 9 Apr 2026 09:48:35 +0100 Subject: [PATCH 1/2] Bump version to 0.3.0 --- Gemfile.lock | 4 ++-- lib/upright/version.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5da1e61..eda297f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - upright (0.2.0) + upright (0.3.0) cgi frozen_record geared_pagination @@ -818,7 +818,7 @@ CHECKSUMS tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f - upright (0.2.0) + upright (0.3.0) uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6 useragent (0.16.11) sha256=700e6413ad4bb954bb63547fa098dddf7b0ebe75b40cc6f93b8d54255b173844 validate_url (1.0.15) sha256=72fe164c0713d63a9970bd6700bea948babbfbdcec392f2342b6704042f57451 diff --git a/lib/upright/version.rb b/lib/upright/version.rb index eddde11..78ec531 100644 --- a/lib/upright/version.rb +++ b/lib/upright/version.rb @@ -1,3 +1,3 @@ module Upright - VERSION = "0.2.0" + VERSION = "0.3.0" end From 2032d9be7218301177f5c084dab8c386baeff53d Mon Sep 17 00:00:00 2001 From: Lewis Buckley Date: Thu, 9 Apr 2026 09:59:20 +0100 Subject: [PATCH 2/2] Replace network_mode: host with port mapping for macOS compatibility Docker Desktop on macOS/Windows runs in a Linux VM, so network_mode: host refers to the VM's network rather than the host machine. This causes Prometheus to be unreachable from the Rails app. Replace with explicit port mapping and extra_hosts (host.docker.internal) which works cross-platform: natively on Docker Desktop, and via the host-gateway directive on Linux Docker Engine 20.10+. Fixes #28 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../upright/install/templates/development_prometheus.yml | 2 +- .../upright/install/templates/docker-compose.yml | 5 ++++- test/dummy/config/prometheus.yml | 2 +- test/dummy/docker-compose.yml | 8 ++++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/generators/upright/install/templates/development_prometheus.yml b/lib/generators/upright/install/templates/development_prometheus.yml index a2cb523..00bbe59 100644 --- a/lib/generators/upright/install/templates/development_prometheus.yml +++ b/lib/generators/upright/install/templates/development_prometheus.yml @@ -9,4 +9,4 @@ scrape_configs: - job_name: "upright" scrape_interval: 5s static_configs: - - targets: ["localhost:9394"] + - targets: ["host.docker.internal:9394"] diff --git a/lib/generators/upright/install/templates/docker-compose.yml b/lib/generators/upright/install/templates/docker-compose.yml index 03f2d1b..6502182 100644 --- a/lib/generators/upright/install/templates/docker-compose.yml +++ b/lib/generators/upright/install/templates/docker-compose.yml @@ -2,7 +2,10 @@ services: prometheus: image: prom/prometheus:v3.4.1 container_name: <%= app_name %>-prometheus - network_mode: host + ports: + - "9090:9090" + extra_hosts: + - "host.docker.internal:host-gateway" volumes: - ./config/prometheus/development/prometheus.yml:/etc/prometheus/prometheus.yml:ro - ./config/prometheus/rules:/etc/prometheus/rules:ro diff --git a/test/dummy/config/prometheus.yml b/test/dummy/config/prometheus.yml index a2cb523..00bbe59 100644 --- a/test/dummy/config/prometheus.yml +++ b/test/dummy/config/prometheus.yml @@ -9,4 +9,4 @@ scrape_configs: - job_name: "upright" scrape_interval: 5s static_configs: - - targets: ["localhost:9394"] + - targets: ["host.docker.internal:9394"] diff --git a/test/dummy/docker-compose.yml b/test/dummy/docker-compose.yml index fa1e5df..108aa18 100644 --- a/test/dummy/docker-compose.yml +++ b/test/dummy/docker-compose.yml @@ -2,7 +2,10 @@ services: prometheus: image: prom/prometheus:v3.4.1 container_name: upright-prometheus - network_mode: host + ports: + - "9090:9090" + extra_hosts: + - "host.docker.internal:host-gateway" volumes: - ./config/prometheus.yml:/etc/prometheus/prometheus.yml:ro - ./config/prometheus/rules:/etc/prometheus/rules:ro @@ -16,7 +19,8 @@ services: alertmanager: image: prom/alertmanager:v0.28.1 container_name: upright-alertmanager - network_mode: host + ports: + - "9093:9093" volumes: - ./config/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro - alertmanager_data:/alertmanager