Applying the Next.js standalone option to Rallit
Key point
By applying Next.js's standalone option, Rallit reduced its Docker image size and shortened deployment time.
Details
Rallit, Inflab's recruitment service, had been using a heavy Docker image of about 4.67GB. To solve this, the team introduced Next.js's standalone option and carried out an optimization that extracts only the minimal code needed for the deployment environment.
Applying the standalone option generates a /standalone folder as a build output, which dramatically reduces the Docker image size and shortens push/pull times to Amazon ECR, improving overall deployment speed.
The key implementation points are as follows:
- Monorepo handling: Solved path issues occurring in a monorepo under a Next.js v12 environment using the
outputFileTracingRootoption. - Preload module configuration: Modules that need to be loaded before execution, such as
dd-traceandpino-logger, were handled viapreload.jsusingNODE_OPTIONSin theDockerfile. - Static file management: The
/staticand/publicfolders, which are excluded during a standalone build, were copied separately to secure the resources needed for service operation.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.