liveBook · Manning

Docker Compose

As explained in Server-Side WebAssembly

Docker Compose is a tool for defining and managing applications composed of multiple Docker containers.

Docker Compose defines and manages multicontainer applications from one configuration file, while creating a virtual network for communication between orchestrated services. section 7.5

A minimal wasmCloud deployment uses Compose to coordinate:

  • A NATS server for wasmCloud communication. section 7.5
  • A wasmCloud host connected to NATS through environment settings. section 7.5
  • A wadm server that uses NATS to manage application deployment. section 7.5

Running the wasmCloud setup

Place docker-compose.yaml and wadm.yaml in a project directory, start the services with docker compose up, deploy with wash app deploy ./wadm.yaml, and verify the HTTP response with curl http://127.0.0.1:8000/. section 7.5

Listing 7.4 docker-compose.yaml for wasmCloud ecosystem
version: "3"
services:
  nats:  #1
    image: nats:2.10-alpine  
    ports:  #2
      - "4222:4222"  
    command: ["-js"]  
  wasmcloud:  #3
    depends_on:   #3
      - "nats"   #3
    image: wasmcloud/wasmcloud:latest   #3
    environment:   #3
      RUST_LOG: debug,hyper=info,async_nats=info,oci_client= #3
      ➥info,cranelift_codegen=warn   #3
      WASMCLOUD_LOG_LEVEL: debug   #3
      WASMCLOUD_RPC_HOST: nats   #3
      WASMCLOUD_CTL_HOST: nats   #3
    ports:   #3
      - "8000:8000"   #3
  wadm:  #4
    depends_on:   #4
      - "nats"   #4
    image: ghcr.io/wasmcloud/wadm:latest   #4
    environment:   #4
      - WADM_NATS_SERVER=nats   #4

Inspect the Compose configuration for NATS, the wasmCloud host, dependencies, images, ports, and environment variables. section 7.5

How Server-Side WebAssembly covers it

How deep it goes
Explains service definitions, dependencies, networking, environment variables, deployment commands, and HTTP verification.
Examples
Uses docker-compose.yaml, wadm.yaml, NATS, a wasmCloud host, an HTTP component, and a curl response.
What you can do after
Operate/configure a local wasmCloud deployment with Docker Compose and verify its HTTP endpoint.
How it connects
Connects Docker containers with wasmCloud, NATS, wadm, Wasm components, and HTTP capability services.

Also explained in

Compare how 15 books explain Docker Compose →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Server-Side WebAssembly. The section links point to the parts of the book it draws on.