[{"data":1,"prerenderedAt":745},["ShallowReactive",2],{"docs-nav":3,"docs:\u002Fdocs\u002Fconfig-files":151},[4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148],{"path":5,"title":6},"\u002Fdocs\u002Faccess-gating","Protect a local route",{"path":8,"title":9},"\u002Fdocs\u002Farchitecture\u002Fsecurity-and-trust","Security and trust",{"path":11,"title":12},"\u002Fdocs\u002Fconcepts\u002Fbuilds-and-deployments","Build and deploy",{"path":14,"title":15},"\u002Fdocs\u002Fconcepts\u002Fconfiguration-ownership","Where configuration belongs",{"path":17,"title":18},"\u002Fdocs\u002Fconcepts\u002Fenvironments-and-secrets","Environment values and secrets",{"path":20,"title":21},"\u002Fdocs\u002Fconcepts\u002Fmental-model","How projects fit together",{"path":23,"title":24},"\u002Fdocs\u002Fconcepts\u002Fplans-and-apply","Plans and apply",{"path":26,"title":27},"\u002Fdocs\u002Fconcepts\u002Ftargets-and-runtimes","Choose a target and runtime",{"path":29,"title":30},"\u002Fdocs\u002Fconfig-files","Ship config files with a service",{"path":32,"title":33},"\u002Fdocs\u002Fcontribute\u002Freleases","Publish a release",{"path":35,"title":36},"\u002Fdocs\u002Fdevelopment-mounts","Development mounts",{"path":38,"title":39},"\u002Fdocs\u002Fgetting-started","Getting started",{"path":41,"title":42},"\u002Fdocs\u002Fhardening","Harden services and choose their runtime",{"path":44,"title":45},"\u002Fdocs\u002Fhelp\u002Ffaq","FAQ",{"path":47,"title":48},"\u002Fdocs\u002Fhelp\u002Ftroubleshooting","Troubleshooting",{"path":50,"title":51},"\u002Fdocs\u002Fhow-to\u002Fcluster","Run a cluster",{"path":53,"title":54},"\u002Fdocs\u002Fhow-to\u002Fdeploy-production","Prepare a deployment environment",{"path":56,"title":57},"\u002Fdocs\u002Fhow-to\u002Ffrom-docker-swarm","Coming from Docker Swarm",{"path":59,"title":60},"\u002Fdocs\u002Fhow-to\u002Fproduction-checklist","Production checklist",{"path":62,"title":63},"\u002Fdocs","mm documentation",{"path":65,"title":66},"\u002Fdocs\u002Fjobs-and-schedules","Jobs and schedules",{"path":68,"title":69},"\u002Fdocs\u002Flocal-dashboard","Local dashboard",{"path":71,"title":72},"\u002Fdocs\u002Flocal-https","Local HTTPS",{"path":74,"title":75},"\u002Fdocs\u002Flocal-services","Local services",{"path":77,"title":78},"\u002Fdocs\u002Fmcp","Let an AI agent work on your project",{"path":80,"title":81},"\u002Fdocs\u002Fmulti-project-hosts","Run multiple projects on one host",{"path":83,"title":84},"\u002Fdocs\u002Fonboarding","Set up a project",{"path":86,"title":87},"\u002Fdocs\u002Fopenbao","Use OpenBao",{"path":89,"title":90},"\u002Fdocs\u002Fproject\u002Fcontributing","Contributing",{"path":92,"title":93},"\u002Fdocs\u002Fproject\u002Flicense","License",{"path":95,"title":96},"\u002Fdocs\u002Fproject\u002Fsecurity","Security",{"path":98,"title":99},"\u002Fdocs\u002Freference\u002Fcapability-matrix","Supported features and platforms",{"path":101,"title":102},"\u002Fdocs\u002Freference\u002Fcli","CLI command reference",{"path":104,"title":105},"\u002Fdocs\u002Freference\u002Fconfiguration","Configuration",{"path":107,"title":108},"\u002Fdocs\u002Freference\u002Fenvironment-variables","Environment variables",{"path":110,"title":111},"\u002Fdocs\u002Freference\u002Ferrors-and-exit-codes","Errors and exit codes",{"path":113,"title":114},"\u002Fdocs\u002Freference\u002Fknown-issues","Known limitations",{"path":116,"title":117},"\u002Fdocs\u002Fremote-access","Manage remote access",{"path":119,"title":120},"\u002Fdocs\u002Fremote-daemon","Set up a remote host",{"path":122,"title":123},"\u002Fdocs\u002Fruntime-observability","Status, logs, and commands",{"path":125,"title":126},"\u002Fdocs\u002Fsecret-delivery","Pass secrets to your app",{"path":128,"title":129},"\u002Fdocs\u002Fsecret-providers","Choose a secret store",{"path":131,"title":132},"\u002Fdocs\u002Fstart\u002Finstall","Install mm",{"path":134,"title":135},"\u002Fdocs\u002Fterminal-ui","Terminal UI",{"path":137,"title":138},"\u002Fdocs\u002Ftutorials\u002Fdotnet-web-api",".NET web API example",{"path":140,"title":141},"\u002Fdocs\u002Ftutorials\u002Ffirst-local-app","First local app",{"path":143,"title":144},"\u002Fdocs\u002Ftutorials\u002Flaravel-rust","Laravel and Rust example",{"path":146,"title":147},"\u002Fdocs\u002Ftutorials\u002Fnode-fullstack","Node full stack example",{"path":149,"title":150},"\u002Fdocs\u002Fvault","Use HashiCorp Vault",{"id":152,"title":30,"body":153,"description":738,"extension":739,"meta":740,"navigation":741,"path":29,"seo":742,"stem":743,"__hash__":744},"docs\u002Fdocs\u002Fconfig-files.md",{"type":154,"value":155,"toc":731},"minimark",[156,165,170,177,277,292,299,356,370,392,396,415,447,587,596,612,616,645,654,657,665,687,695,699,702,706,727],[157,158,159,160,164],"p",{},"A service often needs a file that is not a secret and not part of its image:\na proxy configuration, an init script, a settings file. List it under the\nservice's ",[161,162,163],"code",{},"config-files"," and mm puts it on every host that runs the service\nand mounts it read-only into the container. When the file changes, the next\ndeployment replaces the containers of the services that mount it and leaves\nthe others running.",[166,167,169],"h2",{"id":168},"declare-a-file","Declare a file",[157,171,172,173,176],{},"The key is the file's path in the container. ",[161,174,175],{},"file"," names a file in the\nmodule's directory, shipped as it is:",[178,179,184],"pre",{"className":180,"code":181,"language":182,"meta":183,"style":183},"language-yaml shiki shiki-themes mm","modules:\n  proxy:\n    path: proxy\n    services:\n      proxy:\n        stack: app\n        config-files:\n          \u002Fetc\u002Fnginx\u002Fconf.d\u002Fsite.conf: { file: site.conf }\n","yaml","",[161,185,186,199,207,220,228,236,247,255],{"__ignoreMap":183},[187,188,191,195],"span",{"class":189,"line":190},"line",1,[187,192,194],{"class":193},"sWZmh","modules",[187,196,198],{"class":197},"sIbZ0",":\n",[187,200,202,205],{"class":189,"line":201},2,[187,203,204],{"class":193},"  proxy",[187,206,198],{"class":197},[187,208,210,213,216],{"class":189,"line":209},3,[187,211,212],{"class":193},"    path",[187,214,215],{"class":197},":",[187,217,219],{"class":218},"sv8ni"," proxy\n",[187,221,223,226],{"class":189,"line":222},4,[187,224,225],{"class":193},"    services",[187,227,198],{"class":197},[187,229,231,234],{"class":189,"line":230},5,[187,232,233],{"class":193},"      proxy",[187,235,198],{"class":197},[187,237,239,242,244],{"class":189,"line":238},6,[187,240,241],{"class":193},"        stack",[187,243,215],{"class":197},[187,245,246],{"class":218}," app\n",[187,248,250,253],{"class":189,"line":249},7,[187,251,252],{"class":193},"        config-files",[187,254,198],{"class":197},[187,256,258,261,263,266,269,271,274],{"class":189,"line":257},8,[187,259,260],{"class":193},"          \u002Fetc\u002Fnginx\u002Fconf.d\u002Fsite.conf",[187,262,215],{"class":197},[187,264,265],{"class":197}," {",[187,267,268],{"class":193}," file",[187,270,215],{"class":197},[187,272,273],{"class":218}," site.conf",[187,275,276],{"class":197}," }\n",[157,278,279,280,283,284,287,288,291],{},"Here ",[161,281,282],{},"proxy\u002Fsite.conf"," in the project becomes ",[161,285,286],{},"\u002Fetc\u002Fnginx\u002Fconf.d\u002Fsite.conf","\nin the ",[161,289,290],{},"proxy"," container. Commit the file: a remote host reads it from the\ncommit it deploys.",[157,293,294,295,298],{},"The file is owned by the user mm runs as on the host (root on a remote host)\nand has mode ",[161,296,297],{},"0444",", so every user in the container can read it and none can\nchange it. To change that, set a numeric owner or a mode:",[178,300,302],{"className":180,"code":301,"language":182,"meta":183,"style":183},"config-files:\n  \u002Fetc\u002Fapp\u002Fsettings.toml:\n    file: settings.toml\n    uid: \"101\"\n    gid: \"101\"\n    mode: 0o440\n",[161,303,304,310,317,327,337,346],{"__ignoreMap":183},[187,305,306,308],{"class":189,"line":190},[187,307,163],{"class":193},[187,309,198],{"class":197},[187,311,312,315],{"class":189,"line":201},[187,313,314],{"class":193},"  \u002Fetc\u002Fapp\u002Fsettings.toml",[187,316,198],{"class":197},[187,318,319,322,324],{"class":189,"line":209},[187,320,321],{"class":193},"    file",[187,323,215],{"class":197},[187,325,326],{"class":218}," settings.toml\n",[187,328,329,332,334],{"class":189,"line":222},[187,330,331],{"class":193},"    uid",[187,333,215],{"class":197},[187,335,336],{"class":218}," \"101\"\n",[187,338,339,342,344],{"class":189,"line":230},[187,340,341],{"class":193},"    gid",[187,343,215],{"class":197},[187,345,336],{"class":218},[187,347,348,351,353],{"class":189,"line":238},[187,349,350],{"class":193},"    mode",[187,352,215],{"class":197},[187,354,355],{"class":218}," 0o440\n",[157,357,358,361,362,365,366,369],{},[161,359,360],{},"uid"," and ",[161,363,364],{},"gid"," need mm to run as root on the host, which ",[161,367,368],{},"mmd"," does. On your\nown machine, leave them out.",[157,371,372,373,378,379,361,381,383,384,387,388,391],{},"On hosts that run ",[374,375,377],"a",{"href":376},".\u002Fremote-daemon#run-podman-on-the-hosts","Podman",", each\nservice has user ids of its own: ",[161,380,360],{},[161,382,364],{}," are the container's, and mm\ngives the file to the host ids they are there (root's when left out). They\nhave to be from 0 to 65535; ",[161,385,386],{},"mm config validate"," refuses others with\n",[161,389,390],{},"MM_USER_NAMESPACE",".",[166,393,395],{"id":394},"render-a-file-from-bindings","Render a file from bindings",[157,397,398,399,402,403,405,406,409,410,414],{},"Use ",[161,400,401],{},"template"," instead of ",[161,404,175],{}," when the content differs between\nenvironments. Every ",[161,407,408],{},"{{ KEY }}"," in the template is replaced by the\nenvironment's ",[374,411,413],{"href":412},".\u002Freference\u002Fconfiguration#bindings-environments-and-secrets","binding","\nof that key:",[178,416,420],{"className":417,"code":418,"language":419,"meta":183,"style":183},"language-nginx shiki shiki-themes mm","# proxy\u002Fsite.conf.tmpl\nserver {\n  server_name {{ APP.HOST }};\n  location \u002F { proxy_pass http:\u002F\u002F{{ APP.UPSTREAM }}; }\n}\n","nginx",[161,421,422,427,432,437,442],{"__ignoreMap":183},[187,423,424],{"class":189,"line":190},[187,425,426],{},"# proxy\u002Fsite.conf.tmpl\n",[187,428,429],{"class":189,"line":201},[187,430,431],{},"server {\n",[187,433,434],{"class":189,"line":209},[187,435,436],{},"  server_name {{ APP.HOST }};\n",[187,438,439],{"class":189,"line":222},[187,440,441],{},"  location \u002F { proxy_pass http:\u002F\u002F{{ APP.UPSTREAM }}; }\n",[187,443,444],{"class":189,"line":230},[187,445,446],{},"}\n",[178,448,450],{"className":180,"code":449,"language":182,"meta":183,"style":183},"bindings:\n  APP.UPSTREAM: { value: \"web:8080\" }\nenvironments:\n  production:\n    bindings:\n      APP.HOST: { value: shop.example.com }\nmodules:\n  proxy:\n    path: proxy\n    services:\n      proxy:\n        stack: app\n        config-files:\n          \u002Fetc\u002Fnginx\u002Fconf.d\u002Fsite.conf: { template: site.conf.tmpl }\n",[161,451,452,459,478,485,492,499,517,523,529,538,545,552,561,568],{"__ignoreMap":183},[187,453,454,457],{"class":189,"line":190},[187,455,456],{"class":193},"bindings",[187,458,198],{"class":197},[187,460,461,464,466,468,471,473,476],{"class":189,"line":201},[187,462,463],{"class":193},"  APP.UPSTREAM",[187,465,215],{"class":197},[187,467,265],{"class":197},[187,469,470],{"class":193}," value",[187,472,215],{"class":197},[187,474,475],{"class":218}," \"web:8080\"",[187,477,276],{"class":197},[187,479,480,483],{"class":189,"line":209},[187,481,482],{"class":193},"environments",[187,484,198],{"class":197},[187,486,487,490],{"class":189,"line":222},[187,488,489],{"class":193},"  production",[187,491,198],{"class":197},[187,493,494,497],{"class":189,"line":230},[187,495,496],{"class":193},"    bindings",[187,498,198],{"class":197},[187,500,501,504,506,508,510,512,515],{"class":189,"line":238},[187,502,503],{"class":193},"      APP.HOST",[187,505,215],{"class":197},[187,507,265],{"class":197},[187,509,470],{"class":193},[187,511,215],{"class":197},[187,513,514],{"class":218}," shop.example.com",[187,516,276],{"class":197},[187,518,519,521],{"class":189,"line":249},[187,520,194],{"class":193},[187,522,198],{"class":197},[187,524,525,527],{"class":189,"line":257},[187,526,204],{"class":193},[187,528,198],{"class":197},[187,530,532,534,536],{"class":189,"line":531},9,[187,533,212],{"class":193},[187,535,215],{"class":197},[187,537,219],{"class":218},[187,539,541,543],{"class":189,"line":540},10,[187,542,225],{"class":193},[187,544,198],{"class":197},[187,546,548,550],{"class":189,"line":547},11,[187,549,233],{"class":193},[187,551,198],{"class":197},[187,553,555,557,559],{"class":189,"line":554},12,[187,556,241],{"class":193},[187,558,215],{"class":197},[187,560,246],{"class":218},[187,562,564,566],{"class":189,"line":563},13,[187,565,252],{"class":193},[187,567,198],{"class":197},[187,569,571,573,575,577,580,582,585],{"class":189,"line":570},14,[187,572,260],{"class":193},[187,574,215],{"class":197},[187,576,265],{"class":197},[187,578,579],{"class":193}," template",[187,581,215],{"class":197},[187,583,584],{"class":218}," site.conf.tmpl",[187,586,276],{"class":197},[157,588,589,590,593,594,391],{},"Nothing else in a template is special: there are no conditions, loops, or\nescapes. A file that has to contain ",[161,591,592],{},"{{"," itself is shipped with ",[161,595,175],{},[157,597,598,599,601,602,608,609,391],{},"A template never takes a secret. A config file is kept on the host as it is,\nand its content decides its version, so ",[161,600,386],{}," refuses a\nplaceholder whose binding is a secret and says how to ship it instead: mount\nthe secret with ",[374,603,605],{"href":604},".\u002Fsecret-delivery#file-delivery",[161,606,607],{},"secret-files"," and have\nthe configuration read ",[161,610,611],{},"\u002Frun\u002Fsecrets\u002F\u003Cname>",[166,613,615],{"id":614},"check-and-deploy","Check and deploy",[178,617,621],{"className":618,"code":619,"language":620,"meta":183,"style":183},"language-sh shiki shiki-themes mm","mm config validate\nmm deploy plan\n","sh",[161,622,623,635],{"__ignoreMap":183},[187,624,625,629,632],{"class":189,"line":190},[187,626,628],{"class":627},"svrjQ","mm",[187,630,631],{"class":218}," config",[187,633,634],{"class":218}," validate\n",[187,636,637,639,642],{"class":189,"line":201},[187,638,628],{"class":627},[187,640,641],{"class":218}," deploy",[187,643,644],{"class":218}," plan\n",[157,646,647,649,650,653],{},[161,648,386],{}," reads every file and renders every template for the\nenvironment. It fails with ",[161,651,652],{},"MM_CONFIG_FILE"," when a file is missing, a path\nleaves the module's directory, or a placeholder names no binding, and the\nmessage says which entry and what to write.",[157,655,656],{},"The plan lists each config file with what it does to the service:",[178,658,663],{"className":659,"code":661,"language":662,"meta":183},[660],"language-text","  config file: app\u002Fproxy \u002Fetc\u002Fnginx\u002Fconf.d\u002Fsite.conf from template proxy\u002Fsite.conf.tmpl (version 3f2a9c1b04de): changed, app\u002Fproxy is replaced\n  config file: app\u002Fweb \u002Fetc\u002Fapp\u002Fsettings.toml from web\u002Fsettings.toml (version 9d41c07e52aa): unchanged\n","text",[161,664,661],{"__ignoreMap":183},[666,667,668,675,681],"ul",{},[669,670,671,674],"li",{},[161,672,673],{},"new",": the service did not mount this file before.",[669,676,677,680],{},[161,678,679],{},"changed",": the content, owner, or mode differs from what the last finished\ndeployment mounted. The service's container is replaced. A changed binding\ncounts when a template uses it.",[669,682,683,686],{},[161,684,685],{},"unchanged",": the service keeps its container, unless something else about\nit changed.",[157,688,689,690,694],{},"On a cluster target each node renders the files of the services placed on\nit, and the plan shows the lines in every node's section. The services roll\n",[374,691,693],{"href":692},".\u002Fremote-daemon#rolling-deploys-and-rollback","one node at a time"," like any\nother change, and a service that mounts no changed file is not replaced on\nany node.",[166,696,698],{"id":697},"versions-on-the-host","Versions on the host",[157,700,701],{},"mm keeps each version of a file under its own name on the host, so a running\ncontainer keeps the file it was started with until it is replaced. You never\nrename a file to roll it out. When a deployment has finished, mm removes the\nversions no service mounts any more. A deployment that fails and is rolled\nback removes nothing, so the containers it returns to still find their files.",[166,703,705],{"id":704},"limits","Limits",[666,707,708,711,714,717],{},[669,709,710],{},"A config file is at most 1 MiB. Ship larger data in the image or a volume.",[669,712,713],{},"The mount is one read-only file. A program that replaces its configuration\nfile in place cannot do so, and a file that changes does not reach a\nrunning container: the container is replaced instead.",[669,715,716],{},"Do not also mount something at the same path in the Compose file. The\nengine refuses two mounts at one path when it creates the container.",[669,718,719,720,722,723,726],{},"Values come from ",[161,721,456],{}," in the configuration. A value overridden on\none machine with ",[161,724,725],{},"mm env set"," is not used in a template.",[728,729,730],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sWZmh, html code.shiki .sWZmh{--shiki-default:var(--mm-code-key)}html pre.shiki code .sIbZ0, html code.shiki .sIbZ0{--shiki-default:var(--mm-code-punctuation)}html pre.shiki code .sv8ni, html code.shiki .sv8ni{--shiki-default:var(--mm-code-string)}html pre.shiki code .svrjQ, html code.shiki .svrjQ{--shiki-default:var(--mm-code-function)}",{"title":183,"searchDepth":201,"depth":201,"links":732},[733,734,735,736,737],{"id":168,"depth":201,"text":169},{"id":394,"depth":201,"text":395},{"id":614,"depth":201,"text":615},{"id":697,"depth":201,"text":698},{"id":704,"depth":201,"text":705},"Mount a proxy configuration or an init script into a service, and replace only that service when the file changes.","md",{},true,{"title":30,"description":738},"docs\u002Fconfig-files","XuyUXA2DwxlJlywk9JKDuma4xeD5RYOuLU1ITmS9Xgc",1794776824176]