DONE: use ip for frontend but point to domain for api
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# Host ports (used until nginx terminates TLS on 443)
|
||||
ADMIN_HOST_PORT=5000
|
||||
TELLER_HOST_PORT=3001
|
||||
CUSTOMER_HOST_PORT=3000
|
||||
|
||||
# Domains — also set these as Gitea secrets, then rebuild FE images
|
||||
# VITE_API_URL / NEXT_PUBLIC_API_URL = https://qms-api.erahn.com.my
|
||||
# VITE_CUSTOMER_APP_URL = https://qms-customer.erahn.com.my
|
||||
VITE_API_URL=https://qms-api.erahn.com.my
|
||||
VITE_CUSTOMER_APP_URL=https://qms-customer.erahn.com.my
|
||||
NEXT_PUBLIC_API_URL=https://qms-api.erahn.com.my
|
||||
|
||||
# Public app URLs (reference for nginx / bookmarks)
|
||||
# ADMIN: https://qms-admin.erahn.com.my
|
||||
# TELLER: https://qms-teller.erahn.com.my
|
||||
# CUSTOMER: https://qms-customer.erahn.com.my
|
||||
# API: https://qms-api.erahn.com.my
|
||||
|
||||
# Runtime (customer Next.js server)
|
||||
QR_TOKEN_SECRET=qms-branch-qr-v1
|
||||
|
||||
# Registry images (used by compose / deploy)
|
||||
ADMIN_IMAGE=git.koppkb.com/kopkb/qms-fe-admin
|
||||
TELLER_IMAGE=git.koppkb.com/kopkb/qms-fe-teller
|
||||
CUSTOMER_IMAGE=git.koppkb.com/kopkb/qms-fe-customer
|
||||
IMAGE_TAG=local
|
||||
+2
-7
@@ -1,17 +1,12 @@
|
||||
# Host ports (change if they collide on the single server)
|
||||
ADMIN_HOST_PORT=5000
|
||||
TELLER_HOST_PORT=3001
|
||||
CUSTOMER_HOST_PORT=3000
|
||||
|
||||
# Baked into images at build time (set matching Gitea secrets too)
|
||||
VITE_API_URL=http://YOUR_SERVER_IP:8080
|
||||
VITE_CUSTOMER_APP_URL=http://YOUR_SERVER_IP:3000
|
||||
NEXT_PUBLIC_API_URL=http://YOUR_SERVER_IP:8080
|
||||
VITE_API_URL=https://qms-api.erahn.com.my
|
||||
NEXT_PUBLIC_API_URL=https://qms-api.erahn.com.my
|
||||
|
||||
# Runtime (customer Next.js server)
|
||||
QR_TOKEN_SECRET=qms-branch-qr-v1
|
||||
|
||||
# Registry images (used by compose / deploy)
|
||||
ADMIN_IMAGE=git.koppkb.com/kopkb/qms-fe-admin
|
||||
TELLER_IMAGE=git.koppkb.com/kopkb/qms-fe-teller
|
||||
CUSTOMER_IMAGE=git.koppkb.com/kopkb/qms-fe-customer
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
# Host ports (change if they collide on the single server)
|
||||
ADMIN_HOST_PORT=5000
|
||||
TELLER_HOST_PORT=3001
|
||||
CUSTOMER_HOST_PORT=3000
|
||||
|
||||
VITE_API_URL=http://172.16.6.200:8080
|
||||
VITE_CUSTOMER_APP_URL=http://172.16.6.200:3000
|
||||
NEXT_PUBLIC_API_URL=http://172.16.6.200:8080
|
||||
VITE_API_URL=https://qms-api.erahn.com.my
|
||||
NEXT_PUBLIC_API_URL=https://qms-api.erahn.com.my
|
||||
|
||||
# Runtime (customer Next.js server)
|
||||
QR_TOKEN_SECRET=qms-branch-qr-v1
|
||||
|
||||
# Registry images (used by compose / deploy)
|
||||
ADMIN_IMAGE=git.koppkb.com/kopkb/qms-fe-admin
|
||||
TELLER_IMAGE=git.koppkb.com/kopkb/qms-fe-teller
|
||||
CUSTOMER_IMAGE=git.koppkb.com/kopkb/qms-fe-customer
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
VITE_API_URL=https://qms-api.erahn.com.my
|
||||
@@ -0,0 +1,2 @@
|
||||
# Baked into the admin image at build time (Gitea secret VITE_API_URL)
|
||||
VITE_API_URL=https://qms-api.erahn.com.my
|
||||
@@ -3,9 +3,7 @@ FROM node:20-bookworm AS build
|
||||
WORKDIR /app
|
||||
|
||||
ARG VITE_API_URL=http://localhost:8080
|
||||
ARG VITE_CUSTOMER_APP_URL=http://localhost:3000
|
||||
ENV VITE_API_URL=$VITE_API_URL
|
||||
ENV VITE_CUSTOMER_APP_URL=$VITE_CUSTOMER_APP_URL
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
export const SERVER_URL =
|
||||
import.meta.env.VITE_API_URL ?? 'http://localhost:8080';
|
||||
export const SERVER_URL = import.meta.env.VITE_API_URL;
|
||||
|
||||
export const CUSTOMER_APP_URL =
|
||||
import.meta.env.VITE_CUSTOMER_APP_URL ?? 'http://localhost:3000';
|
||||
export const CUSTOMER_APP_URL = 'https://qms-customer.erahn.com.my';
|
||||
|
||||
export const ROLES = {
|
||||
ROLE_SUPER_ADMIN : "ROLE_SUPER_ADMIN",
|
||||
ROLE_BRANCH_ADMIN : "ROLE_BRANCH_ADMIN"
|
||||
}
|
||||
ROLE_SUPER_ADMIN: 'ROLE_SUPER_ADMIN',
|
||||
ROLE_BRANCH_ADMIN: 'ROLE_BRANCH_ADMIN',
|
||||
};
|
||||
|
||||
@@ -6,7 +6,6 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
VITE_API_URL: ${VITE_API_URL:-http://localhost:8080}
|
||||
VITE_CUSTOMER_APP_URL: ${VITE_CUSTOMER_APP_URL:-http://localhost:3000}
|
||||
container_name: qms-fe-admin
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
|
||||
Reference in New Issue
Block a user