diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 0e97c29..c184079 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -13,8 +13,8 @@ COPY --from=deps /app/node_modules ./node_modules COPY . . # Set production environment -ENV NEXT_TELEMETRY_DISABLED 1 -ENV NODE_ENV production +ENV NEXT_TELEMETRY_DISABLED=1 +ENV NODE_ENV=production RUN npm run build @@ -22,8 +22,8 @@ RUN npm run build FROM node:20-alpine AS runner WORKDIR /app -ENV NODE_ENV production -ENV NEXT_TELEMETRY_DISABLED 1 +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs @@ -42,8 +42,8 @@ USER nextjs EXPOSE 3000 -ENV PORT 3000 -ENV HOSTNAME "0.0.0.0" +ENV PORT=3000 +ENV HOSTNAME="0.0.0.0" CMD ["node", "server.js"] diff --git a/frontend/lib/api.ts b/frontend/lib/api.ts index 85d63dc..bbd8dc1 100644 --- a/frontend/lib/api.ts +++ b/frontend/lib/api.ts @@ -7,7 +7,7 @@ import { APIError, } from './types' -const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8080/api/v1' +const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || '/api/v1' class APIClient { private baseURL: string diff --git a/frontend/public/.gitkeep b/frontend/public/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/k8s.yaml b/k8s.yaml index 7f1297d..2f15ef2 100644 --- a/k8s.yaml +++ b/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