19 changed files with 428 additions and 334 deletions
-
44.dockerignore
-
46Dockerfile
-
21docker-compose.yml
-
5next.config.ts
-
11src/app/api/healthz/route.ts
-
11src/app/healthz/route.ts
-
4src/components/Componentes/button.tsx
-
73src/components/Componentes/call-result-sheet.tsx
-
73src/components/Componentes/dismiss-reason-sheet.tsx
-
57src/components/Componentes/female-consent-sheet.tsx
-
54src/components/Componentes/female-outcome-sheet.tsx
-
68src/components/Componentes/help-modal.tsx
-
56src/components/Componentes/information-sheet.tsx
-
2src/components/Componentes/navigation-button.tsx
-
54src/components/Componentes/outcome-selection-sheet.tsx
-
62src/components/Componentes/support-sheet.tsx
-
4src/components/Componentes/test-questions-flow.tsx
-
91src/components/Componentes/token-switcher.tsx
-
26src/lib/auth-bridge.ts
@ -1,7 +1,45 @@ |
|||||
|
# ────────────────────────────────────────────────────────────────────────── |
||||
|
# Docker Build Ignore Configuration for Marriage WebApp |
||||
|
# ────────────────────────────────────────────────────────────────────────── |
||||
|
|
||||
|
# Build artifacts & dependencies |
||||
node_modules |
node_modules |
||||
.next |
.next |
||||
|
dist |
||||
|
out |
||||
|
|
||||
|
# Version control & git metadata |
||||
.git |
.git |
||||
.gitignore |
.gitignore |
||||
README.md |
|
||||
.env* |
|
||||
npm-debug.log* |
|
||||
|
|
||||
|
# Environment files (injected at runtime/build via env_file / args) |
||||
|
.env |
||||
|
.env*.local |
||||
|
.env.development |
||||
|
|
||||
|
# Documentation, reports & scratch files |
||||
|
*.md |
||||
|
*.log |
||||
|
*.log.* |
||||
|
next-dev-*.log |
||||
|
next-dev-*.err.log |
||||
|
proxy-debug.log |
||||
|
scratch |
||||
|
docs |
||||
|
.playwright-mcp |
||||
|
.agents |
||||
|
.codex |
||||
|
.claude |
||||
|
.vscode |
||||
|
.idea |
||||
|
|
||||
|
# Tests |
||||
|
**/*.test.ts |
||||
|
**/*.test.tsx |
||||
|
**/*.spec.ts |
||||
|
**/*.spec.tsx |
||||
|
vitest.config.ts |
||||
|
|
||||
|
# Docker files (not needed in context) |
||||
|
docker-compose.yml |
||||
|
docker-compose.*.yml |
||||
@ -1,30 +1,60 @@ |
|||||
FROM node:20-alpine AS base |
|
||||
|
# syntax=docker/dockerfile:1.7 |
||||
|
|
||||
FROM base AS deps |
|
||||
|
# ────────────────────────────────────────────────────────────────────────── |
||||
|
# مرحلهٔ ۱ — base & deps: آمادهسازی وابستگیها با کش npm |
||||
|
# ────────────────────────────────────────────────────────────────────────── |
||||
|
FROM node:22-alpine AS deps |
||||
RUN apk add --no-cache libc6-compat |
RUN apk add --no-cache libc6-compat |
||||
WORKDIR /app |
WORKDIR /app |
||||
|
|
||||
COPY package.json package-lock.json* ./ |
COPY package.json package-lock.json* ./ |
||||
RUN npm ci |
|
||||
|
RUN npm install |
||||
|
|
||||
FROM base AS builder |
|
||||
|
# ────────────────────────────────────────────────────────────────────────── |
||||
|
# مرحلهٔ ۲ — builder: ساخت خروجی بهینهشده standalone برای Next.js |
||||
|
# ────────────────────────────────────────────────────────────────────────── |
||||
|
FROM node:22-alpine AS builder |
||||
WORKDIR /app |
WORKDIR /app |
||||
|
|
||||
COPY --from=deps /app/node_modules ./node_modules |
COPY --from=deps /app/node_modules ./node_modules |
||||
COPY . . |
COPY . . |
||||
ARG NEXT_PUBLIC_API_BASE_URL |
|
||||
ARG NEXT_PUBLIC_SECURITY_KEY |
|
||||
|
|
||||
|
# آرگومانهای بیلد برای فرانتاند |
||||
|
ARG NEXT_PUBLIC_API_BASE_URL=https://habibapp.com |
||||
|
ARG NEXT_PUBLIC_SECURITY_KEY=t5yugymks5458fd4ghfg6h6fg |
||||
ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL |
ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL |
||||
ENV NEXT_PUBLIC_SECURITY_KEY=$NEXT_PUBLIC_SECURITY_KEY |
ENV NEXT_PUBLIC_SECURITY_KEY=$NEXT_PUBLIC_SECURITY_KEY |
||||
|
ENV NEXT_TELEMETRY_DISABLED=1 |
||||
|
ENV NODE_ENV=production |
||||
|
|
||||
RUN npm run build |
RUN npm run build |
||||
|
|
||||
FROM base AS runner |
|
||||
|
# ────────────────────────────────────────────────────────────────────────── |
||||
|
# مرحلهٔ ۳ — runner: سرور مینیمال و امن standalone در محیط پروداکشن |
||||
|
# ────────────────────────────────────────────────────────────────────────── |
||||
|
FROM node:22-alpine AS runner |
||||
WORKDIR /app |
WORKDIR /app |
||||
|
|
||||
ENV NODE_ENV=production |
ENV NODE_ENV=production |
||||
|
ENV NEXT_TELEMETRY_DISABLED=1 |
||||
|
ENV PORT=3000 |
||||
|
ENV HOSTNAME="0.0.0.0" |
||||
|
|
||||
|
# ایجاد کاربر غیر روت برای امنیت کانتینر |
||||
RUN addgroup --system --gid 1001 nodejs && \ |
RUN addgroup --system --gid 1001 nodejs && \ |
||||
adduser --system --uid 1001 nextjs |
adduser --system --uid 1001 nextjs |
||||
|
|
||||
|
# کپی داراییهای استاتیک و خروجی standalone |
||||
COPY --from=builder /app/public ./public |
COPY --from=builder /app/public ./public |
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ |
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ |
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static |
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static |
||||
|
|
||||
USER nextjs |
USER nextjs |
||||
|
|
||||
EXPOSE 3000 |
EXPOSE 3000 |
||||
ENV PORT=3000 HOSTNAME="0.0.0.0" |
|
||||
|
|
||||
|
# هلثچک داخلی و سبک کانتینر |
||||
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \ |
||||
|
CMD wget -qO- http://localhost:3000/healthz || exit 1 |
||||
|
|
||||
CMD ["node", "server.js"] |
CMD ["node", "server.js"] |
||||
@ -0,0 +1,11 @@ |
|||||
|
export const dynamic = "force-dynamic"; |
||||
|
|
||||
|
export async function GET() { |
||||
|
return new Response("ok", { |
||||
|
status: 200, |
||||
|
headers: { |
||||
|
"Content-Type": "text/plain", |
||||
|
"Cache-Control": "no-cache, no-store, must-revalidate", |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
export const dynamic = "force-dynamic"; |
||||
|
|
||||
|
export async function GET() { |
||||
|
return new Response("ok", { |
||||
|
status: 200, |
||||
|
headers: { |
||||
|
"Content-Type": "text/plain", |
||||
|
"Cache-Control": "no-cache, no-store, must-revalidate", |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue