fix: resolve Kong image tag and port conflicts for shared server

- Change Kong base image from kong:3.7-alpine (non-existent) to kong:3.7
- Remap all host ports to avoid conflicts with existing iconsulting services:
  - Backend services: 13001-13008 (was 3001-3008)
  - Web admin: 13000 (was 3000)
  - API gateway: 18000/18001 (was 8000/8001)
  - PostgreSQL: 15432 (was 5432)
  - Redis: 16379 (was 6379)
- Add container_name with it0- prefix to all services
- Update deploy.sh health check ports to match new mappings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-19 04:36:23 -08:00
parent 9120f4927e
commit e875cd49bb
3 changed files with 44 additions and 32 deletions

View File

@ -320,15 +320,15 @@ status() {
health() { health() {
# Format: "service-name:port:health-endpoint" # Format: "service-name:port:health-endpoint"
local services=( local services=(
"auth-service:3001:/api/health" "auth-service:13001:/api/health"
"agent-service:3002:/api/health" "agent-service:13002:/api/health"
"ops-service:3003:/api/health" "ops-service:13003:/api/health"
"inventory-service:3004:/api/health" "inventory-service:13004:/api/health"
"monitor-service:3005:/api/health" "monitor-service:13005:/api/health"
"comm-service:3006:/api/health" "comm-service:13006:/api/health"
"audit-service:3007:/api/health" "audit-service:13007:/api/health"
"voice-service:3008:/health" "voice-service:13008:/health"
"api-gateway:8000:/status" "api-gateway:18000:/status"
) )
echo "Application Services:" echo "Application Services:"
@ -349,15 +349,15 @@ health() {
echo "Infrastructure:" echo "Infrastructure:"
if docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T postgres pg_isready -U it0 &>/dev/null; then if docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T postgres pg_isready -U it0 &>/dev/null; then
echo -e " ${GREEN}[OK]${NC} PostgreSQL (port 5432)" echo -e " ${GREEN}[OK]${NC} PostgreSQL (port 15432)"
else else
echo -e " ${RED}[FAIL]${NC} PostgreSQL (port 5432)" echo -e " ${RED}[FAIL]${NC} PostgreSQL (port 15432)"
fi fi
if docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T redis redis-cli ping &>/dev/null; then if docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T redis redis-cli ping &>/dev/null; then
echo -e " ${GREEN}[OK]${NC} Redis (port 6379)" echo -e " ${GREEN}[OK]${NC} Redis (port 16379)"
else else
echo -e " ${RED}[FAIL]${NC} Redis (port 6379)" echo -e " ${RED}[FAIL]${NC} Redis (port 16379)"
fi fi
} }
@ -517,15 +517,15 @@ infra_status() {
echo "Health Check:" echo "Health Check:"
if docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T postgres pg_isready -U it0 &>/dev/null; then if docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T postgres pg_isready -U it0 &>/dev/null; then
echo -e " ${GREEN}[OK]${NC} PostgreSQL (port 5432)" echo -e " ${GREEN}[OK]${NC} PostgreSQL (port 15432)"
else else
echo -e " ${RED}[FAIL]${NC} PostgreSQL (port 5432)" echo -e " ${RED}[FAIL]${NC} PostgreSQL (port 15432)"
fi fi
if docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T redis redis-cli ping &>/dev/null; then if docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T redis redis-cli ping &>/dev/null; then
echo -e " ${GREEN}[OK]${NC} Redis (port 6379)" echo -e " ${GREEN}[OK]${NC} Redis (port 16379)"
else else
echo -e " ${RED}[FAIL]${NC} Redis (port 6379)" echo -e " ${RED}[FAIL]${NC} Redis (port 16379)"
fi fi
} }

View File

@ -2,12 +2,13 @@ services:
# ===== Infrastructure ===== # ===== Infrastructure =====
postgres: postgres:
image: postgres:16-alpine image: postgres:16-alpine
container_name: it0-postgres
environment: environment:
POSTGRES_USER: ${POSTGRES_USER:-it0} POSTGRES_USER: ${POSTGRES_USER:-it0}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-it0_dev} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-it0_dev}
POSTGRES_DB: ${POSTGRES_DB:-it0} POSTGRES_DB: ${POSTGRES_DB:-it0}
ports: ports:
- "5432:5432" - "15432:5432"
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
- ./scripts/init-databases.sh:/docker-entrypoint-initdb.d/init-databases.sh - ./scripts/init-databases.sh:/docker-entrypoint-initdb.d/init-databases.sh
@ -21,8 +22,9 @@ services:
redis: redis:
image: redis:7-alpine image: redis:7-alpine
container_name: it0-redis
ports: ports:
- "6379:6379" - "16379:6379"
healthcheck: healthcheck:
test: ["CMD", "redis-cli", "ping"] test: ["CMD", "redis-cli", "ping"]
interval: 10s interval: 10s
@ -35,9 +37,10 @@ services:
api-gateway: api-gateway:
build: build:
context: ../../packages/gateway context: ../../packages/gateway
container_name: it0-api-gateway
ports: ports:
- "8000:8000" - "18000:8000"
- "8001:8001" - "18001:8001"
depends_on: depends_on:
auth-service: auth-service:
condition: service_started condition: service_started
@ -69,8 +72,9 @@ services:
args: args:
SERVICE_NAME: auth-service SERVICE_NAME: auth-service
SERVICE_PORT: 3001 SERVICE_PORT: 3001
container_name: it0-auth-service
ports: ports:
- "3001:3001" - "13001:3001"
environment: environment:
- DB_HOST=postgres - DB_HOST=postgres
- DB_PORT=5432 - DB_PORT=5432
@ -96,8 +100,9 @@ services:
args: args:
SERVICE_NAME: agent-service SERVICE_NAME: agent-service
SERVICE_PORT: 3002 SERVICE_PORT: 3002
container_name: it0-agent-service
ports: ports:
- "3002:3002" - "13002:3002"
environment: environment:
- DB_HOST=postgres - DB_HOST=postgres
- DB_PORT=5432 - DB_PORT=5432
@ -123,8 +128,9 @@ services:
args: args:
SERVICE_NAME: ops-service SERVICE_NAME: ops-service
SERVICE_PORT: 3003 SERVICE_PORT: 3003
container_name: it0-ops-service
ports: ports:
- "3003:3003" - "13003:3003"
environment: environment:
- DB_HOST=postgres - DB_HOST=postgres
- DB_PORT=5432 - DB_PORT=5432
@ -148,8 +154,9 @@ services:
args: args:
SERVICE_NAME: inventory-service SERVICE_NAME: inventory-service
SERVICE_PORT: 3004 SERVICE_PORT: 3004
container_name: it0-inventory-service
ports: ports:
- "3004:3004" - "13004:3004"
environment: environment:
- DB_HOST=postgres - DB_HOST=postgres
- DB_PORT=5432 - DB_PORT=5432
@ -172,8 +179,9 @@ services:
args: args:
SERVICE_NAME: monitor-service SERVICE_NAME: monitor-service
SERVICE_PORT: 3005 SERVICE_PORT: 3005
container_name: it0-monitor-service
ports: ports:
- "3005:3005" - "13005:3005"
environment: environment:
- DB_HOST=postgres - DB_HOST=postgres
- DB_PORT=5432 - DB_PORT=5432
@ -195,8 +203,9 @@ services:
args: args:
SERVICE_NAME: comm-service SERVICE_NAME: comm-service
SERVICE_PORT: 3006 SERVICE_PORT: 3006
container_name: it0-comm-service
ports: ports:
- "3006:3006" - "13006:3006"
environment: environment:
- DB_HOST=postgres - DB_HOST=postgres
- DB_PORT=5432 - DB_PORT=5432
@ -223,8 +232,9 @@ services:
args: args:
SERVICE_NAME: audit-service SERVICE_NAME: audit-service
SERVICE_PORT: 3007 SERVICE_PORT: 3007
container_name: it0-audit-service
ports: ports:
- "3007:3007" - "13007:3007"
environment: environment:
- DB_HOST=postgres - DB_HOST=postgres
- DB_PORT=5432 - DB_PORT=5432
@ -242,8 +252,9 @@ services:
voice-service: voice-service:
build: build:
context: ../../packages/services/voice-service context: ../../packages/services/voice-service
container_name: it0-voice-service
ports: ports:
- "3008:3008" - "13008:3008"
environment: environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- AGENT_SERVICE_URL=http://agent-service:3002 - AGENT_SERVICE_URL=http://agent-service:3002
@ -259,12 +270,13 @@ services:
web-admin: web-admin:
build: build:
context: ../../it0-web-admin context: ../../it0-web-admin
container_name: it0-web-admin
ports: ports:
- "3000:3000" - "13000:3000"
environment: environment:
- API_BASE_URL=http://api-gateway:8000 - API_BASE_URL=http://api-gateway:8000
- NEXT_PUBLIC_API_BASE_URL=/api/proxy - NEXT_PUBLIC_API_BASE_URL=/api/proxy
- NEXT_PUBLIC_WS_URL=ws://localhost:8000 - NEXT_PUBLIC_WS_URL=ws://localhost:18000
depends_on: depends_on:
- api-gateway - api-gateway
networks: networks:

View File

@ -1,4 +1,4 @@
FROM kong:3.7-alpine FROM kong:3.7
COPY config/kong.yml /etc/kong/kong.yml COPY config/kong.yml /etc/kong/kong.yml