Docker
Docker packages a program with everything it needs into an image, and runs images as isolated containers. An image runs the same on a laptop, in CI or on any cloud.
New to Docker? Start with What is Docker?.
A quick example
Section titled “A quick example”Postgres with a named volume, a network alias and a published port:
const image = yield* Docker.RemoteImage("postgres-image", { name: "postgres", tag: "18-alpine" });const network = yield* Docker.Network("app-network");const data = yield* Docker.Volume("postgres-data");
const postgres = yield* Docker.Container("postgres", { image, environment: { POSTGRES_DB: "app", POSTGRES_PASSWORD: password }, ports: [{ external: 15432, internal: 5432 }], volumes: [{ hostPath: data.name, containerPath: "/var/lib/postgresql/data" }], networks: [{ name: network.name, aliases: ["postgres"] }], start: true,});password can be Redacted. It reaches the container through its environment, never on the command line.
Where to start
Section titled “Where to start”Want to build? Connect Alchemy to your engine in Setup, then Run local services builds Postgres on a network and a volume, step by step.
Looking for something specific? Every section of these docs is listed below, and every resource is in the generated API reference.