[{"data":1,"prerenderedAt":121},["ShallowReactive",2],{"tool-content-en-dockerfile-generator":3},{"id":4,"title":5,"body":6,"description":16,"extension":113,"locale":114,"meta":115,"navigation":116,"path":117,"seo":118,"stem":119,"toolId":12,"__hash__":120},"tools\u002Ftools\u002Fen\u002Fdockerfile-generator.md","Dockerfile Generator",{"type":7,"value":8,"toc":106},"minimark",[9,13,17,20,24,74,78],[10,11,5],"h2",{"id":12},"dockerfile-generator",[14,15,16],"p",{},"Generate multi-stage Dockerfiles with a .dockerignore snippet locally in your browser.",[14,18,19],{},"This tool runs entirely in your browser.",[10,21,23],{"id":22},"how-to-use","How to use",[25,26,27,31,34,46,53,60],"ol",{},[28,29,30],"li",{},"Pick a runtime preset (20 languages, PostgreSQL, MySQL, MongoDB, Redis, static sites, or a blank Custom form). It only fills in defaults; every field stays editable.",[28,32,33],{},"Adjust the base image, workdir, install, build, and start commands.",[28,35,36,37,41,42,45],{},"List ports as ",[38,39,40],"code",{},"3000"," or ",[38,43,44],{},"8080:80",", one per comma, space, or line.",[28,47,48,49,52],{},"Add environment variables as one ",[38,50,51],{},"KEY=value"," per line.",[28,54,55,56,59],{},"Optionally enable the multi-stage build, the non-root user, a HEALTHCHECK, and the ",[38,57,58],{},".dockerignore"," tab.",[28,61,62,63,66,67,69,70,73],{},"Copy the result, download it as ",[38,64,65],{},"Dockerfile"," \u002F ",[38,68,58],{},", or grab both as a ",[38,71,72],{},".zip",".",[10,75,77],{"id":76},"notes","Notes",[79,80,81,84,99],"ul",{},[28,82,83],{},"Multi-stage builds compile in a builder stage and copy the workdir into a clean runtime image.",[28,85,86,87,90,91,94,95,98],{},"The non-root option creates the user with ",[38,88,89],{},"useradd",", which Debian, Ubuntu, and Red Hat based images provide. Alpine based images need ",[38,92,93],{},"adduser"," instead, so check the generated ",[38,96,97],{},"RUN"," line when you use them.",[28,100,101,102,105],{},"Start commands are emitted in exec (",[38,103,104],{},"CMD [\"...\"]",") form; quote arguments with spaces.",{"title":107,"searchDepth":108,"depth":108,"links":109},"",2,[110,111,112],{"id":12,"depth":108,"text":5},{"id":22,"depth":108,"text":23},{"id":76,"depth":108,"text":77},"md","en",{},true,"\u002Ftools\u002Fen\u002Fdockerfile-generator",{"title":5,"description":16},"tools\u002Fen\u002Fdockerfile-generator","SPCJ-5hiruFAtqIFHoCjUTwgHJzV9QWGquRJyh2ncBc",1792391417385]