DONE: cicd pipeline for customer fe
This commit is contained in:
+7
-1
@@ -1,12 +1,18 @@
|
||||
# Host ports (change if they collide on the single server)
|
||||
ADMIN_HOST_PORT=5000
|
||||
TELLER_HOST_PORT=3001
|
||||
CUSTOMER_HOST_PORT=3000
|
||||
|
||||
# Baked into the Vite images at build time (set in Gitea secret/variable VITE_API_URL too)
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
# Host ports (change if they collide on the single server)
|
||||
ADMIN_HOST_PORT=5000
|
||||
TELLER_HOST_PORT=3001
|
||||
CUSTOMER_HOST_PORT=3000
|
||||
|
||||
# Replace YOUR_SERVER_IP with the production server IP (API is on :8080)
|
||||
# Also set the same value as Gitea secret/variable VITE_API_URL for CI image builds
|
||||
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
|
||||
|
||||
# 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
|
||||
IMAGE_TAG=local
|
||||
CUSTOMER_IMAGE=git.koppkb.com/kopkb/qms-fe-customer
|
||||
IMAGE_TAG=local
|
||||
@@ -0,0 +1,10 @@
|
||||
node_modules
|
||||
.next
|
||||
.git
|
||||
.gitignore
|
||||
*.md
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
.DS_Store
|
||||
tsconfig.tsbuildinfo
|
||||
@@ -0,0 +1,35 @@
|
||||
# Build stage
|
||||
FROM node:20-bookworm AS build
|
||||
WORKDIR /app
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@9 --activate
|
||||
|
||||
ARG NEXT_PUBLIC_API_URL=http://localhost:8080
|
||||
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
||||
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
COPY . .
|
||||
RUN pnpm build
|
||||
|
||||
# Runtime stage
|
||||
FROM node:20-bookworm-slim AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs \
|
||||
&& adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY --from=build /app/public ./public
|
||||
COPY --from=build --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=build --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
@@ -2,6 +2,7 @@ import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
devIndicators: false,
|
||||
output: "standalone",
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
@@ -22,5 +22,11 @@
|
||||
"eslint-config-next": "16.2.10",
|
||||
"tailwindcss": "^4",
|
||||
"typescript": "^5"
|
||||
},
|
||||
"pnpm": {
|
||||
"ignoredBuiltDependencies": [
|
||||
"sharp",
|
||||
"unrs-resolver"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
ignoredBuiltDependencies:
|
||||
- sharp
|
||||
- unrs-resolver
|
||||
@@ -23,3 +23,17 @@ services:
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${TELLER_HOST_PORT:-3001}:80"
|
||||
|
||||
customer:
|
||||
image: ${CUSTOMER_IMAGE:-qms-fe-customer}:${IMAGE_TAG:-local}
|
||||
build:
|
||||
context: ./customer-app
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:8080}
|
||||
container_name: qms-fe-customer
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${CUSTOMER_HOST_PORT:-3000}:3000"
|
||||
environment:
|
||||
QR_TOKEN_SECRET: ${QR_TOKEN_SECRET:-qms-branch-qr-v1}
|
||||
|
||||
Reference in New Issue
Block a user