Run the full Next.js server — SSR, API routes, ISR and middleware — on a persistent ARM VM instead of a serverless plan. Built for Ampere A1 (arm64), listens on port 3000, and starts with node server.js.
FROM node:22-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci
FROM node:22-alpine AS build
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production PORT=3000
COPY --from=build /app/public ./public
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]Next.js builds natively on ARM64. Set `output: "standalone"` in next.config.js so the runtime image stays under 200 MB — the 1 OCPU / 6 GB shape has plenty of RAM, but a smaller image rebuilds far faster over a home connection.
Cheaploy builds this image on your own Oracle Always Free VM, opens the ports, issues HTTPS and rolls back if health checks fail.