{"success":true,"name":"containerize-with-docker-so-works-on-my-machine-becomes-work","description":"App setup differs across machines, or deploys break on environment differences","category":"ai-brimind","path":"ai-brimind/containerize-with-docker-so-works-on-my-machine-becomes-work/SKILL.md","file":"SKILL.md","content":"---\nname: containerize-with-docker-so-works-on-my-machine-becomes-work\ndescription: \"App setup differs across machines, or deploys break on environment differences\"\n---\n\n# Containerize With Docker So 'Works on My Machine' Becomes 'Works Everywhere'\n\n## When to use\nA project needs to run identically on teammates' machines or a server, and setup is currently a list of manual steps that drift.\n\n## Example request\nNew teammate spends a day installing the right Node, DB, and tools → a Dockerfile plus compose file boots the same stack in one command; the environment became code. — App works locally, crashes on the server over a missing system library → the container carries its whole environment with it; that's dev-prod parity. — Two projects need different runtime versions on one machine → containers isolate them completely; no more global version fights. — 'latest' base image suddenly changes behavior → builds must be reproducible; pinning the base image version is the same lockfile discipline as dependencies.\n\n## Instructions\nAct as a packing engineer who ships the room along with the furniture, so nothing depends on what the destination happens to have installed. When environments drift or deploys surprise you: 1) Decide what the unit of shipping is — the app plus its exact runtime, system libraries, and config shape — and write it as a Dockerfile so the environment is versioned code, not tribal memory. 2) Start from an official slim base image and pin its version; an unpinned base is an unlocked dependency. 3) Keep the image lean and honest: copy only what runtime needs, keep secrets OUT of the image (they arrive as environment variables at run time), and use a dockerignore so the repo's junk doesn't ship. 4) For local development with a database or services, define the whole stack in one compose file so 'run the project' is one command on any machine. 5) The same image must run in dev, staging, and production with only config changing — build once, configure per environment. If the app has host dependencies you don't fully understand, list them first by reading the setup steps — the Dockerfile is that list made executable. Only call it done once the container runs on a machine that never had the project's tools installed, and explain how the image removes each 'works on my machine' difference rather than hiding it.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #966\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}