From bfd9d9e6ce63dae30da1984c2b27897c4d75dc33 Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 19 Jan 2026 11:18:58 -0800 Subject: [PATCH] fix: healthchecks and add standard port sync server access - Fix healthchecks to use wget instead of curl (curl not available in Alpine) - Use 127.0.0.1 instead of localhost (resolves correctly in containers) - Fix syncserver healthcheck to use / instead of /health (no /health endpoint) - Add /taskchampion/ path in nginx for sync server on standard port 443 - Update example.frontend.env to use new /taskchampion/ path Co-Authored-By: Claude Opus 4.5 --- docker-compose.yml | 7 ++++--- production/example.frontend.env | 4 +++- production/example.nginx.conf | 13 ++++++++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b5a7c7b3..cbeafcd2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: # env_file: # - ./frontend/.env healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:80"] + test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:80"] interval: 30s timeout: 10s retries: 3 @@ -30,7 +30,7 @@ services: env_file: - ./backend/.env healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8000/health"] + test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8000/health"] interval: 30s timeout: 10s retries: 3 @@ -44,7 +44,8 @@ services: networks: - tasknetwork healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8080/health"] + # Note: taskchampion-sync-server doesn't have a /health endpoint, use root + test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8080/"] interval: 30s timeout: 10s retries: 3 diff --git a/production/example.frontend.env b/production/example.frontend.env index 531824c2..de30d34c 100644 --- a/production/example.frontend.env +++ b/production/example.frontend.env @@ -1,3 +1,5 @@ VITE_BACKEND_URL="https://your-domain.com/" VITE_FRONTEND_URL="https://your-domain.com" -VITE_CONTAINER_ORIGIN="https://your-domain.com:8080/" +# Use standard port 443 with /taskchampion/ path (recommended) +VITE_CONTAINER_ORIGIN="https://your-domain.com/taskchampion/" +# Or use legacy port 8080: VITE_CONTAINER_ORIGIN="https://your-domain.com:8080/" diff --git a/production/example.nginx.conf b/production/example.nginx.conf index 01dc81e6..040ce19c 100644 --- a/production/example.nginx.conf +++ b/production/example.nginx.conf @@ -171,6 +171,17 @@ server { proxy_read_timeout 86400; } + # Taskchampion sync server on standard port 443 + # Users can configure: task config sync.server.url https://your-domain.com/taskchampion/ + location /taskchampion/ { + proxy_pass http://127.0.0.1:8081/; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + # Frontend (default) location / { proxy_pass http://127.0.0.1:3000; @@ -182,7 +193,7 @@ server { } } -# Taskchampion sync server (port 8080 with SSL) +# Taskchampion sync server (port 8080 with SSL) - Legacy support server { listen 8080 ssl http2; listen [::]:8080 ssl http2;