Meta tags:
description= Customize how services are built into containers;
Headings (most frequently used words):
custom, create, runtimes, container, get, started, build, deploy, languages, reference, misc, add, new, runtime, dockerfile, template, monorepo, with, an, ignore, file, example, for, turborepo,
Text of the page (most frequently used words):
api (48), the (30), file (27), custom (25), route (20), #dockerfile (19), bucket (19), secret (18), run (17), copy (15), sql (15), delete (15), runtime (14), get (14), websocket (14), node (13), services (13), nitric (12), handler (12), overview (12), app (11), docker (11), key (11), put (11), queue (11), topic (11), job (11), this (10), turbo (10), add (9), from (9), build (9), pipfile (9), schedule (9), schedules (9), storage (9), secrets (9), value (9), stores (9), apis (9), create (8), template (8), lock (8), you (8), all (8), queues (8), topics (8), turbo_scope (7), install (7), for (7), service (7), version (7), container (7), websockets (7), batch (7), patch (7), post (7), runtimes (6), entrypoint (6), and (6), that (6), example (6), will (6), use (6), python (6), requirements (6), github (5), monorepo (5), arg (5), yarn (5), set (5), your (5), databases (5), websites (5), support (4), page (4), with (4), new (4), cache (4), json (4), builder (4), dependencies (4), apk (4), update (4), copied (4), guestbook (4), match (4), using (4), can (4), specify (4), files (4), txt (4), cloud (4), aws (4), google (4), azure (4), send (4), write (4), read (4), access (4), dequeue (4), enqueue (4), subscribe (4), publish (4), keys (4), submit (4), search (4), guides (3), foundations (3), have (3), backends (3), workdir (3), alpine (3), out (3), its (3), typescript (3), libc6 (3), compat (3), root (3), context (3), start (3), yaml (3), cli (3), pip (3), found (3), pipenv (3), env (3), which (3), are (3), used (3), configuration (3), built (3), containers (3), close (3), cron (3), every (3), connectionstring (3), latest (3), follow (2), contributions (2), 2026 (2), edit (2), installer (2), lib (2), lockfile (2), gitignore (2), change (2), global (2), why (2), might (2), args (2), npm (2), dev (2), service_path (2), name (2), javascript (2), allows (2), turborepo (2), per (2), shown (2), below (2), templates (2), dockerignore (2), path (2), ignore (2), stat (2), echo (2), final (2), certificates (2), apt (2), dart (2), note (2), variable (2), some (2), dockerfiles (2), how (2), need (2), any (2), language (2), other (2), entrypoints (2), application (2), applications (2), reference (2), getuploadurl (2), getdownloadurl (2), exists (2), resources (2), http (2), async (2), messaging (2), docs (2), youtube, join, our, discord, server, inc, last, updated, jan, open, issue, feedback, index, runner, filter, full, project, frozen, production, first, they, less, often, vercel, ncc, package, isolated, subworkspace, prune, scope, mono, repo, working, directory, check, https, com, nodejs, tree, b4117f9333da4138b03a546ec926ef50a31506c3, nodealpine, understand, needed, type, tool, manage, multiple, packages, single, repository, available, above, supports, monorepos, via, feature, definition, also, located, dir, output, module, there, guarantee, pipfil, loc, either, upgrade, pythonunbuffered, true, slim, specifies, execute, here, important, needs, act, look, bit, different, written, past, since, same, contains, filename, specifying, handlers, their, simply, customize, process, optimize, size, reason, decides, those, based, programming, these, designed, compatibility, ease, mind, makes, building, convenient, but, may, not, provide, additional, code, relies, ideal, optimization, builds, identifying, typically, defined, each, into, own, then, deployed, such, lambda, cloudrun, apps, faq, examples, misc, vars, config, preview, features, sqldatabase, uploadurl, downloadurl, listfiles, accessversion, newroute, newwebsocket, newschedule, newtopic, newbucket, newsqldatabase, newsecret, newqueue, newkv, newjob, newapi, connection_string, upload_url, download_url, methods, languages, adding, resource, types, providers, provider, extension, mappings, terraform, pulumi, deploy, hpc, architecture, deployment, local, development, security, infrastructure, projects, quick, installation, started, introduction, documentation,
Text of the page (random words):
reference custom service containers nitric documentation foundations guides search search docs 1 9k search search docs introduction get started installation quick start guides foundations why nitric projects overview configuration infrastructure overview services resources security local development deployment architecture overview services apis schedules websockets websites storage key value stores async messaging queues topics sql databases secrets build apis batch ai ml hpc schedules websockets websites storage key value stores sql databases async messaging secrets deploy overview pulumi overview aws google cloud azure terraform overview aws google cloud azure service mappings aws apis batch schedules websockets websites storage key value stores sql databases topics queues secrets azure apis schedules websites storage key value stores sql databases topics queues secrets google cloud apis batch schedules websites storage key value stores sql databases topics queues secrets custom overview provider extension custom providers adding resource types install with docker languages overview node js overview apis api api get api post api put api delete api patch api route api route all api route get api route post api route put api route delete api route patch batch job job handler job submit http http key value stores kv kv get kv set kv delete kv keys topics topic topic publish topic subscribe queues queue queue enqueue queue dequeue secrets secret secret put secret version secret latest secret version access storage bucket bucket on bucket file bucket files file exists file read file write file delete file getdownloadurl file getuploadurl sql sql sql connectionstring schedules schedule schedule every schedule cron websockets websocket websocket on websocket send websocket close python overview apis api api get api post api put api delete api patch api methods api all batch job job handler job submit key value stores kv kv get kv set kv delete kv keys topics topic topic publish topic subscribe queues queue queue enqueue queue dequeue secrets secret secret put secret version secret latest secret version access storage bucket bucket on bucket file bucket files file read file write file delete file download_url file upload_url sql sql sql connection_string schedules schedule websockets websocket websocket on websocket send go overview resources newapi newjob newkv newqueue newsecret newsqldatabase newbucket newtopic newschedule newwebsocket apis api get api post api put api delete api patch api newroute api route all api route get api route post api route put api route delete api route patch batch job handler job submit key value stores kv get kv set kv delete kv keys topics topic publish topic subscribe queues queue enqueue queue dequeue secrets secret put secret accessversion secret access storage bucket on bucket listfiles bucket read bucket write bucket delete bucket downloadurl bucket uploadurl sql sqldatabase connectionstring schedules schedule every schedule cron websockets websocket on websocket send websocket close dart overview apis api api all api get api post api put api delete api patch api route api route all api route get api route post api route put api route delete api route patch batch job job handler job submit key value stores kv kv get kv set kv delete kv keys topics topic topic publish topic subscribe queues queue queue enqueue queue dequeue secrets secret secret put secret version secret latest secret version access storage bucket bucket on bucket file bucket files file exists file read file write file delete file getdownloadurl file getuploadurl sql sql sql connectionstring schedules schedule schedule every schedule cron websockets websocket websocket on websocket send websocket close reference cli preview features other config env vars custom service containers misc examples faq contributions support custom container runtimes nitric builds applications by identifying its entrypoints which are typically defined in the nitric yaml file as services each entrypoint in a nitric app is built into its own container using docker then deployed to a cloud container runtime such as aws lambda google cloudrun or azure container apps the nitric cli decides how to build those containers based on the programming language used by the entrypoint for example if the entrypoint is a python file it will be built using nitric s python dockerfile template these dockerfile templates are designed with compatibility and ease of use in mind this makes building applications convenient but may not provide additional dependencies your code relies or the ideal optimization for your application if you need to customize the docker container build process to add dependencies optimize container size support a new language or any other reason you can create a custom dockerfile template to be used by some or all of the entrypoints services in your application add a new custom runtime add a new custom runtime in the runtimes configuration to use the runtime simply specify the runtime key per service as shown below nitric yaml copy copied name custom example services match services ts runtime custom node specify custom runtime start npm run dev services service_path runtimes custom node all services that specify the custom node runtime will be built using this dockerfile dockerfile docker node dockerfile args in this example we re specifying that any handlers that match the path services ts will use a custom node dockerfile for their dockerfile template create a dockerfile template it s important to note that the custom dockerfile you create needs to act as a template this can look a bit different to how you might have written dockerfiles in the past since the same template file will need to be used for all services that match the configuration the entrypoint will use a variable which contains the service s filename here are some example dockerfiles note the handler variable which specifies the handler to execute in the final container python javascript typescript go dart copy copied from python 3 11 slim arg handler env handler handler env pythonunbuffered true run apt get update y apt get install y ca certificates update ca certificates run pip install upgrade pip pipenv copy either requirements txt or pipfile copy requirements tx t pipfil e pipfile loc k guarantee lock file if we have a pipfile and no pipfile lock run stat pipfile pipenv lock echo no pipfile found output a requirements txt file for final module install if there is a pipfile lock found run stat pipfile lock pipenv requirements requirements txt echo no pipfile lock found run pip install no cache dir r requirements txt copy entrypoint python handler create an ignore file custom dockerfile templates also support co located dockerignore files if your custom docker template is at path docker node dockerfile you can create an ignore file at docker node dockerfile dockerignore create a monorepo with custom runtimes nitric supports monorepos via the custom runtime feature this allows you to change the build context of your docker build to use a custom runtime in a monorepo you can specify the runtime key per service definition as shown below available in nitric cli version 1 45 0 and above example for turborepo turborepo is a monorepo tool for javascript and typescript that allows you to manage multiple packages in a single repository in this example we will use a custom runtime to build a service in a monorepo using a custom dockerfile root backends guestbook app nitric yaml copy copied name guestbook app services match services ts runtime turbo type start npm run dev services service_path runtimes turbo dockerfile turbo dockerfile the custom dockerfile context the context of the docker build args turbo_scope guestbook api root backends guestbook app turbo dockerfile copy copied from node alpine as builder arg turbo_scope check https github com nodejs docker node tree b4117f9333da4138b03a546ec926ef50a31506c3 nodealpine to understand why libc6 compat might be needed run apk add no cache libc6 compat run apk update set working directory workdir app run yarn global add turbo copy from root of the mono repo copy run turbo prune scope turbo_scope docker add lockfile and package json s of isolated subworkspace from node alpine as installer arg turbo_scope arg handler run apk add no cache libc6 compat run apk update workdir app run yarn global add typescript vercel ncc turbo first install dependencies as they change less often copy gitignore gitignore copy from builder app out json copy from builder app out yarn lock yarn lock run yarn install frozen lockfile production build the project and its dependencies copy from builder app out full copy turbo json turbo json run turbo run build filter turbo_scope handler m v8 cache o lib from node alpine as runner arg turbo_scope workdir app copy from installer app backends turbo_scope lib entrypoint node index js edit this page on github have feedback on this page open github issue last updated on jan 5 2026 on this page add a new custom runtime create a dockerfile template create a monorepo with custom runtimes edit this page on github 2026 nitric inc contributions support foundations guides follow us on x follow us on github join our discord server youtube
|