๐Ÿณ
DockerCraftDockerfile & Compose Generator
15 Frameworks
8 Presets
v2.0 Version
Live
Generate production-ready Docker configurations instantly ยท Ctrl+1/2/3 to switch tabs
v2.0.0 ยท MIT License

Quick-Start Templates

6 stacks
โšก

Next.js Full-Stack

Next.js app with PostgreSQL database and Redis cache

JavaScript
PostgreSQL
Redis
๐Ÿ

FastAPI + PostgreSQL

Python FastAPI REST API with PostgreSQL

Python
PostgreSQL
REST
๐Ÿš€

Go + Redis

High-performance Go API with Redis caching

Go
Redis
Performance
โš›๏ธ

React SPA + Nginx

React Vite app served by production-optimised Nginx

React
Nginx
SPA
๐ŸŒฟ

Node.js + MongoDB

Express.js API with MongoDB database

Node.js
MongoDB
Express
โ˜•

Spring Boot + MySQL

Java Spring Boot REST API with MySQL database

Java
MySQL
Spring

Configuration

Dockerfile options
Framework
Configuration
Optimizations

Multi-Stage Build

Smaller production image

Non-Root User

Run as non-privileged user (security)

Health Check

Docker health check endpoint

Environment Variables

Generated Output

Real-time preview
Live
Dockerfile
27 lines
1# โ”€โ”€โ”€ Stage 1: Dependencies โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
2FROM node:20-alpine AS deps
3WORKDIR /app
4COPY package*.json ./
5RUN npm ci
6
7# โ”€โ”€โ”€ Stage 2: Builder โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
8FROM node:20-alpine AS builder
9WORKDIR /app
10COPY --from=deps /app/node_modules ./node_modules
11COPY . .
12RUN npm run build
13
14# โ”€โ”€โ”€ Stage 3: Runner โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
15FROM node:20-alpine AS runner
16WORKDIR /app
17ENV NODE_ENV=production
18RUN addgroup --system --gid 1001 appgroup && \
19    adduser --system --uid 1001 --ingroup appgroup appuser
20
21COPY --from=builder /app/node_modules ./node_modules
22COPY --from=builder /app/package.json ./package.json
23
24USER appuser
25
26EXPOSE 3000
27CMD ["node server.js"]