{"uid":"cap_YpJnk0P1DDqvciERQH1ug","slug":"api-strale-io-5998c132","name":"Dockerfile Generator (api.strale.io)","description":"Generate optimized, production-ready Dockerfiles. Multi-stage builds, Alpine base, non-root user, layer caching. Supports Node, Python, Go, Rust, Java.","url":"https://api.strale.io/x402/dockerfile-generate","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["language"],"properties":{"alpine":{"type":"boolean"},"language":{"type":"string"},"framework":{"type":"string"},"multi_stage":{"type":"boolean"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"alpine":true,"language":"Node","framework":"Express","multi_stage":true},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.054000000000000006,"settlement_id":"0xc4ff4ddc805668d3c232ea36fda98e650dbd01354da934a99037ced150c0b389"},"capability":"dockerfile-generate","latency_ms":5610,"provenance":{"source":"claude-haiku","fetched_at":"2026-06-13T04:26:07.931Z"}},"stages":["builder","production"],"language":"node","framework":"Express","build_args":[],"dockerfile":"# Build stage\nFROM node:20-alpine AS builder\n\nWORKDIR /app\n\n# Copy package files\nCOPY package*.json ./\n\n# Install dependencies\nRUN npm ci --only=production && \\\n    npm cache clean --force\n\n# Copy application source\nCOPY . .\n\n# Optional: Build step if needed (e.g., TypeScript compilation)\n# RUN npm run build\n\n# Production stage\nFROM node:20-alpine\n\n# Install dumb-init for proper signal handling\nRUN apk add --no-cache dumb-init\n\nWORKDIR /app\n\n# Create non-root user\nRUN addgroup -g 1001 -S nodejs && \\\n    adduser -S nodejs -u 1001\n\n# Copy node_modules and app from builder\nCOPY --from=builder --chown=nodejs:nodejs /app/node_modules ./node_modules\nCOPY --from=builder --chown=nodejs:nodejs /app . .\n\n# Switch to non-root user\nUSER nodejs\n\n# Expose port\nEXPOSE 3000\n\n# Health check\nHEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\\n    CMD node -e \"require('http').get('http://localhost:3000/health', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})\" || exit 1\n\n# Use dumb-init to handle signals properly\nENTRYPOINT [\"dumb-init\", \"--\"]\n\n# Start application\nCMD [\"node\", \"index.js\"]","multi_stage":true,"security_notes":["Multi-stage build reduces final image size and excludes build tools","Non-root user (nodejs) prevents privilege escalation","Alpine Linux minimizes attack surface and dependencies","dumb-init ensures proper signal handling and zombie process cleanup","npm ci used instead of npm install for deterministic installs","Only production dependencies included in final image","Health check validates application availability","Read-only root filesystem recommended at runtime"],"estimated_image_size":"120-150MB","dockerignore_recommended":[".git",".gitignore","node_modules","npm-debug.log",".npm",".env",".env.local",".env.*.local",".DS_Store","dist","build",".vscode",".idea","*.md","LICENSE",".dockerignore","docker-compose*.yml",".editorconfig",".eslintrc*",".prettierrc*","jest.config.js","coverage",".nyc_output","test","tests",".github",".gitlab-ci.yml",".circleci"]}},"exampleRequest":{"alpine":true,"language":"Node","framework":"Express","multi_stage":true},"tags":["x402"],"displayCostAmount":"0.054001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.054001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_egGejFHxBtjJv26rZj25B","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.054","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generates optimized, production-ready Dockerfiles with multi-stage builds, Alpine base, non-root user, and layer caching for Node, Python, Go, Rust, and Java.","exampleAgentPrompt":"Generate an optimized production-ready Dockerfile for a Node.js Express app — use Alpine base, enable multi-stage builds, and make sure it runs as a non-root user.","exampleUseCases":null,"resultDescription":"Returns a complete, production-ready Dockerfile as text, incorporating multi-stage build patterns, Alpine base images for minimal footprint, non-root user configuration for security, and optimized layer caching instructions tailored to the specified language and framework.","failureModes":["Missing required 'language' query parameter returns a 400 error","Unsupported language value returns an error indicating supported languages (Node, Python, Go, Rust, Java)","Payment not completed or invalid x402 payment header results in 402 Payment Required","Service unavailable returns a 5xx error"],"whenToPreferThis":"Use this endpoint when you need a best-practice, production-hardened Dockerfile quickly without manually writing one — especially when security (non-root), image size (Alpine), build speed (layer caching), or CI/CD readiness (multi-stage) are priorities. Prefer this over generic LLM Dockerfile generation when you want a consistently structured, opinionated output for a known language stack.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":2,"lastUsedAt":"2026-06-01T13:15:32.439Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:49:38.635Z","isFirstParty":false}