Skip to content
Novus Examples
dockerfile419 B

Dockerfile (multi-stage)

A sample multi-stage Dockerfile with a build stage and a slim runtime stage — for testing Dockerfile parsers, linters (hadolint), and syntax highlighting. Illustrative only.

Preview — first 17 linesdockerfile
# Novus Examples — sample multi-stage Dockerfile (illustrative; not built here).
FROM node:22-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build /app/.next ./.next
COPY --from=build /app/public ./public
COPY --from=build /app/package.json ./
EXPOSE 3000
CMD ["npm", "start"]

Specifications

Format
Dockerfile
Stages
2
Base Image
node:22-alpine

What is a .dockerfile file?

A Dockerfile is a plain-text script of instructions that Docker reads to build a container image layer by layer, using directives like FROM, RUN, COPY, and CMD. Each instruction defines a step in assembling a reproducible image. It is the standard definition format for containerized applications.

How to use this file

Use an example Dockerfile to test instruction parsers and linters, build-tool integration, and tooling that analyzes or generates container image definitions.

Generated by generation/data_dev_fixtures.py. Free for any use, no attribution required — license.