Dockerfile generator for your stack

Pick a stack and a few options and get a Dockerfile and a matching .dockerignore, ready to copy or download. Nothing is read from an existing project: you describe the new one.

Generate your files

What you get

Sample output

Dockerfile
# syntax=docker/dockerfile:1
FROM node:24-alpine AS base
WORKDIR /app

FROM base AS deps
COPY package.json package-lock.json* ./
RUN npm ci --omit=dev && mkdir -p node_modules

FROM base AS build
COPY package.json package-lock.json* ./
RUN npm ci
COPY . .
RUN npm run build
RUN rm -rf node_modules && mkdir -p .next/cache && mv .next /next

FROM base AS runtime
ENV NODE_ENV=production PORT=3000
# The code and its dependencies belong to root: the app can read them, not rewrite them.
COPY --from=build /app ./
COPY --from=deps /app/node_modules ./node_modules
# Next.js writes its cache under .next: the only folder of the app the node user can write (it is empty for other apps).
COPY --from=build --chown=1000:1000 /next ./.next
USER 1000:1000
EXPOSE 3000
CMD ["npm","start"]
Dockerfile for a Node.js project with npm (multi-stage, runs as the node user). Generated by Dockcrate.

How it works

  1. Pick a stack and the options you need.
  2. Preview every file, and edit or switch off any block.
  3. Copy the files or download them as a zip.

Questions

Is the generated Dockerfile multi-stage?

Yes by default. A build stage holds the compilers and dev dependencies and the runtime stage copies only what it needs. You can switch to a single stage, either production only or build and production mixed.

Does it read my project?

No. You choose the stack and the options and the files are generated from that. The notes next to the output say what your project must provide, for example a start script for Node.js.

Will the Dockerfile build without changes?

It is a very good first draft, not a guarantee. It is checked as text but never built here, so expect small edits such as ports, commands or package names.

Can I use it from the command line?

Yes. The same generator runs as a CLI and as this web page.