Fix frontend unable to load weather data by using relative API URL
NEXT_PUBLIC_API_URL was only set at runtime via k8s ConfigMap, but Next.js inlines NEXT_PUBLIC_* vars at build time. The fallback localhost:8080 URL was baked into the JS bundle, causing all browser requests to fail. Changed default to relative /api/v1 which routes correctly through the Ingress. Also updates Dockerfile ENV syntax and k8s frontend port to 8080. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
36
k8s.yaml
36
k8s.yaml
@@ -4,6 +4,30 @@ kind: Namespace
|
||||
metadata:
|
||||
name: paragliding
|
||||
|
||||
---
|
||||
# External PostgreSQL Service (points to host database)
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres-service
|
||||
namespace: paragliding
|
||||
spec:
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Endpoints
|
||||
metadata:
|
||||
name: postgres-service
|
||||
namespace: paragliding
|
||||
subsets:
|
||||
- addresses:
|
||||
- ip: 192.168.1.93
|
||||
ports:
|
||||
- port: 5432
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@@ -106,7 +130,7 @@ spec:
|
||||
image: harbor.scottyah.com/scottyah/paragliding-web:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
- containerPort: 8080
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: paragliding-config
|
||||
@@ -120,13 +144,13 @@ spec:
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 3000
|
||||
port: 8080
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 3000
|
||||
port: 8080
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
imagePullSecrets:
|
||||
@@ -140,8 +164,8 @@ metadata:
|
||||
namespace: paragliding
|
||||
spec:
|
||||
ports:
|
||||
- port: 3000
|
||||
targetPort: 3000
|
||||
- port: 8080
|
||||
targetPort: 8080
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: paragliding-web
|
||||
@@ -179,4 +203,4 @@ spec:
|
||||
service:
|
||||
name: paragliding-web-svc
|
||||
port:
|
||||
number: 3000
|
||||
number: 8080
|
||||
|
||||
Reference in New Issue
Block a user