From ad84c38641e9513b00932780805ded0c47d1a2a1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 30 Apr 2026 19:55:50 +0000 Subject: [PATCH] fix: backend port 3001 -> 3002 to match Caddy upstream config Caddy routes /api/* and /webhooks/* to 172.20.1.238:3002 but the docker-compose had PORT=3001 and bound port 3001. Changed: - PORT env var: 3001 -> 3002 - Port binding: 0.0.0.0:3002:3002 - Health check: localhost:3002/health - Next.js rewrites: localhost:3001 -> localhost:3002 - Frontend port: 127.0.0.1 -> 0.0.0.0 (Caddy remote access) --- docker-compose.prod.yml | 8 ++++---- frontend/next-env.d.ts | 2 +- frontend/next.config.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index cd084a9..1f7997a 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -73,7 +73,7 @@ services: - NODE_ENV=production - DATABASE_URL=postgresql://coop:${POSTGRES_PASSWORD:-coop_secure_password}@postgres:5432/coop_credits?schema=public - REDIS_URL=redis://:${REDIS_PASSWORD:-redis_secure_password}@redis:6379 - - PORT=3001 + - PORT=3002 - JWT_SECRET=${JWT_SECRET} - API_URL=https://coop.hobokenchicken.com - FRONTEND_URL=https://coop.hobokenchicken.com @@ -97,7 +97,7 @@ services: - ENCRYPTION_KEY=${ENCRYPTION_KEY} - TRUST_PROXY=true ports: - - "127.0.0.1:3001:3001" # Only accessible via Nginx + - "0.0.0.0:3002:3002" # Only accessible via Nginx depends_on: postgres: condition: service_healthy @@ -115,7 +115,7 @@ services: max-file: "5" # Health check healthcheck: - test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3001/health"] + test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3002/health"] interval: 30s timeout: 10s retries: 3 @@ -139,7 +139,7 @@ services: - NEXT_PUBLIC_SOLANA_NETWORK=devnet - NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com ports: - - "127.0.0.1:3000:3000" # Only accessible via Nginx + - "0.0.0.0:3000:3000" # Only accessible via Nginx depends_on: - backend networks: diff --git a/frontend/next-env.d.ts b/frontend/next-env.d.ts index c4b7818..9edff1c 100644 --- a/frontend/next-env.d.ts +++ b/frontend/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/dev/types/routes.d.ts"; +import "./.next/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/frontend/next.config.js b/frontend/next.config.js index 28a3320..5174633 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -6,11 +6,11 @@ const nextConfig = { return [ { source: '/api/:path*', - destination: 'http://localhost:3001/api/:path*', + destination: 'http://localhost:3002/api/:path*', }, { source: '/webhooks/:path*', - destination: 'http://localhost:3001/webhooks/:path*', + destination: 'http://localhost:3002/webhooks/:path*', }, ]; },