Next.js అనేక deployment లక్ష్యాలను సపోర్ట్ చేస్తుంది, ఇది output కాన్ఫిగ్ చేత పాక్షికంగా నియంత్రిస్తారు. సరైన ఎంపిక Node సర్వర్, కంటైనర్లు లేదా పూర్తిగా స్టాటిక్ హోస్టింగ్ అవసరమైతే ఆధారపడి ఉంటుంది.
బిల్డ్ అవుట్పుట్ మోడ్లు
. = {
};
Next.js అనేక deployment లక్ష్యాలను సపోర్ట్ చేస్తుంది, ఇది output కాన్ఫిగ్ చేత పాక్షికంగా నియంత్రిస్తారు. సరైన ఎంపిక Node సర్వర్, కంటైనర్లు లేదా పూర్తిగా స్టాటిక్ హోస్టింగ్ అవసరమైతే ఆధారపడి ఉంటుంది.
. = {
};
Node.js సర్వర్ను నడుపుతుంది, కాబట్టి మీరు ప్రతిదీ పొందుతారు: SSR, ISR, Server Actions, Route Handlers, ఇమేజ్ ఆప్టిమైజేషన్, middleware. ఇది Vercel (Next.js యొక్క నిర్మాత, జీరో-కాన్ఫిగ్) మరియు Node హోస్టుల వంటి ప్లాట్ఫారమ్ల ద్వారా ఉపయోగించబడుతుంది.
# Next traces only the needed files into .next/standalone → a tiny, self-contained server
COPY --from=builder /app/.next/standalone ./
CMD ["node", "server.js"]
standalone నిజానికి ఉపయోగించిన అవసరాలతో మాత్రమే కనిష్ట ఫోల్డర్ను ఉత్పత్తి చేస్తుంది, AWS, GCP, మీ స్వంత సర్వర్లు మొదలైనవిపై చిన్న Docker ఇమేజ్ల కోసం ఆదర్శంగా ఉంటుంది. మీరు సర్వర్ ఫీచర్లను నిర్వహిస్తారు.
next build → out/ (plain HTML/CSS/JS, deployable to any static host: S3, GitHub Pages, Netlify CDN)
స్టాటిక్ ఎక్సపోర్ట్ చcheapestsimplest హోస్టింగ్ ఇస్తుంది కానీ సర్వర్ ఫీచర్లను నిష్క్రియం చేస్తుంది: SSR లేదు, ISR లేదు, Route Handlers లేదు, Server Actions లేదు, ఆన్-ది-ఫ్లై ఇమేజ్ ఆప్టిమైజేషన్ లేదు. పూర్తిగా స్టాటిక్ సైట్ల కోసం మాత్రమే అనువైనది.
Need SSR/ISR/Server Actions, want zero-config → Vercel (or a Node host) — default output
Want containers / self-host with full features → output: "standalone" + Docker
Purely static content (docs, marketing) → output: "export" → any static CDN
- Runtime choice (Edge vs Node) affects where functions run
- Self-hosting ISR/caching needs persistent storage or a shared cache
- Image optimization on non-Vercel hosts may need a custom loader
Deployment ఒక-పరిమాణం-సరిపోలుములేనిది: output మోడ్ ఏ Next.js ఫీచర్లు జీవించి ఉన్నాయో నిర్ణయిస్తుంది.
డిఫాల్ట్/Node అవుట్పుట్ సర్వర్ సామర్థ్యాలను నిర్వహిస్తుందని, standalone వాటిని Docker/స్వీయ-హోస్టింగ్ కోసం ప్యాకేజ్ చేస్తుందని, export అన్ని సర్వర్ ఫీచర్లను పూర్తిగా స్టాటిక్ హోస్టింగ్ కోసం కూడా బిల్డ్ను మీ సరిపెట్టుకోవడానికి అనుమతిస్తుంది వ్యవస్థ — మరియు output: "export" SSR/ISR/Server Actions చెక్కుమెచ్చుకుపోయే ఆపదను నివారించండి.