Docker Environments logo

Docker Environments

Organization
memi-design
docker-environments

Docker-aware Mémoire operation — CI/CD headless pipelines, shared MCP server, agent worker containers, and Figma bridge port-forwarding for containerized setups

Overview

Publishermemi-design
Repositorydesign-skills
Skill namedocker-environments
Stars
7
Forks
0
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by memi-design on GitHub. Read the source before you install it.

Installation

Install the Docker Environments AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/memi-design/design-skills/tree/main/skills/docker-environments
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/memi-design/design-skills.git /tmp/design-skills
mkdir -p .claude/skills
cp -r /tmp/design-skills/skills/docker-environments .claude/skills/docker-environments
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Docker Environments in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Docker Environments on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Docker Environments is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Docker Environments


name: Docker Environments category: connect activateOn: docker-environment freedomLevel: high version: 1.0.0 description: > Docker-aware Mémoire operation. Detects Dockerfile, docker-compose.yml, and .devcontainer/ in the project root and adapts the Mémoire pipeline accordingly. Covers Figma bridge port-forwarding, CI/CD headless audits, shared MCP server as a team service, agent worker containers, and devcontainer setup.

1. Auto-Detection

Mémoire activates this Note when any of the following are present in the project root:

File / DirectorySignals
DockerfileSingle-service container build
docker-compose.yml / docker-compose.yamlMulti-service orchestration
compose.yml / compose.yamlCompose v2 convention
.devcontainer/devcontainer.jsonVS Code / Codespaces dev environment
.devcontainer/docker-compose.ymlDevcontainer with compose override

When detected, Mémoire applies these Docker-aware defaults:

  • Bridge discovery checks localhost AND host.docker.internal
  • Preview server binds to 0.0.0.0 (not 127.0.0.1)
  • Port conflict warnings include Docker port-mapping guidance
  • memi doctor output includes container networking status

2. Figma Bridge in Docker

Problem: Figma plugin runs on the host machine. Mémoire inside a container cannot auto-discover it — localhost inside the container is the container, not the host.

Fix: Forward the bridge port range from host to container.

yaml
# docker-compose.yml
services:
  memoire:
    ports:
      - "9223-9232:9223-9232"  # Figma bridge range
json
// .memoire/project.json
{
  "bridge": {
    "host": "0.0.0.0",
    "portRange": [9223, 9232]
  }
}

When NOT to use Docker for canvas work: If your primary workflow is Figma canvas operations (design, library, real-time sync), run Mémoire on the host. Port forwarding works but adds latency. Use Docker for CI, MCP, and agent workers.


3. CI/CD Headless Pipeline

Headless-Safe Commands

CommandNeeds BridgeCI-Safe
memi audit --wcagNoYes
memi spec validateNoYes
memi generateNoYes
memi research synthesizeNoYes
memi previewNoYes
memi pullYesNo
memi syncYesNo
memi connectYesNo

Dockerfile (CI Build)

dockerfile
FROM node:20-alpine AS base
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts
COPY . .
RUN npm run build

FROM base AS ci
ENV MEMOIRE_HEADLESS=true
ENV MEMOIRE_NO_BRIDGE=true
ENTRYPOINT ["node", "dist/cli.js"]

docker-compose.yml with Profiles

yaml
version: "3.9"
services:
  # Local dev — bridge enabled, ports forwarded
  memoire-dev:
    build: { context: ., target: base }
    profiles: ["dev"]
    ports:
      - "4400:4400"
      - "4401:4401"
      - "9223-9232:9223-9232"
    volumes: [".:/app", "/app/node_modules"]
    environment: [MEMOIRE_ENV=development]
    command: ["node", "dist/cli.js", "watch", "--code"]

  # CI — headless, no bridge
  memoire-ci:
    build: { context: ., target: ci }
    profiles: ["ci"]
    volumes: [".:/workspace"]
    working_dir: /workspace
    environment: [MEMOIRE_HEADLESS=true, MEMOIRE_NO_BRIDGE=true]
    command: ["node", "dist/cli.js", "audit", "--wcag", "--exit-code"]

  # MCP server — shared team service
  memoire-mcp:
    build: { context: ., target: base }
    profiles: ["mcp"]
    ports: ["4402:4402"]
    environment: [MEMOIRE_MCP_PORT=4402]
    command: ["node", "dist/cli.js", "mcp", "start"]
    restart: unless-stopped

Running CI Audits

bash
# Run headless WCAG audit
docker compose --profile ci run --rm memoire-ci

# Validate all specs
docker compose --profile ci run --rm memoire-ci \
  node dist/cli.js spec validate --all --strict

# Dry-run code generation
docker compose --profile ci run --rm memoire-ci \
  node dist/cli.js generate --dry-run

GitHub Actions

yaml
name: Design System CI
on: [push, pull_request]
jobs:
  design-audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: WCAG audit
        run: docker compose --profile ci run --rm memoire-ci
      - name: Validate specs
        run: docker compose --profile ci run --rm memoire-ci node dist/cli.js spec validate --all --strict
      - name: Generate (dry run)
        run: docker compose --profile ci run --rm memoire-ci node dist/cli.js generate --dry-run

Exit Codes

CodeMeaningGate
0All pass—
1WarningsFail with --fail-on-warn
2ErrorsAlways fails
3Critical violationsAlways fails

Soft policy: gate on 2+. Strict policy: gate on 1+.


4. Shared MCP Server (Team Service)

Problem: Each developer running memi mcp start locally produces divergent design system state.

Fix: Deploy one containerized MCP instance. All Claude Code and Cursor sessions on the team point to it.

dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
VOLUME ["/workspace/.memoire"]
EXPOSE 4402
CMD ["node", "dist/cli.js", "mcp", "start", "--port", "4402"]

Claude Code config for each developer — replace localhost with the shared host:

json
{
  "mcpServers": {
    "memoire": {
      "url": "http://memoire.internal:4402/mcp",
      "transport": "http"
    }
  }
}

Shared volume for .memoire/ state:

yaml
services:
  memoire-mcp:
    volumes:
      - design-system:/workspace/.memoire
    command: ["node", "dist/cli.js", "mcp", "start"]

volumes:
  design-system:
    driver: local
    driver_opts:
      type: nfs
      o: addr=nas.internal,rw
      device: ":/design-system"

5. Agent Workers as Containers

Each role gets isolated resources, its own restart policy, and no shared process state.

yaml
services:
  token-engineer:
    build: .
    command: ["node", "dist/cli.js", "agent", "spawn", "token-engineer"]
    environment: [MEMOIRE_AGENT_ROLE=token-engineer]
    restart: on-failure:3
    healthcheck:
      test: ["CMD", "node", "dist/cli.js", "agent", "status", "--role", "token-engineer", "--json"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s

  component-architect:
    build: .
    command: ["node", "dist/cli.js", "agent", "spawn", "component-architect"]
    environment: [MEMOIRE_AGENT_ROLE=component-architect]
    restart: on-failure:3

  accessibility-checker:
    build: .
    command: ["node", "dist/cli.js", "agent", "spawn", "accessibility-checker"]
    environment: [MEMOIRE_AGENT_ROLE=accessibility-checker]
    restart: on-failure:3

  orchestrator:
    build: .
    command: ["node", "dist/cli.js", "compose", "--listen"]
    depends_on: [token-engineer, component-architect, accessibility-checker]
    restart: unless-stopped

Scale bottleneck roles (the task queue is lock-based — multiple workers are safe):

bash
docker compose up --scale code-generator=3

6. Devcontainer Support

json
// .devcontainer/devcontainer.json
{
  "name": "Mémoire Dev",
  "dockerComposeFile": "docker-compose.yml",
  "service": "memoire-dev",
  "workspaceFolder": "/app",
  "features": {
    "ghcr.io/devcontainers/features/node:1": { "version": "20" }
  },
  "forwardPorts": [4400, 4401, 9223, 9224, 9225],
  "postCreateCommand": "npm ci && npm run build",
  "customizations": {
    "vscode": {
      "extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
    }
  },
  "remoteEnv": {
    "FIGMA_ACCESS_TOKEN": "${localEnv:FIGMA_ACCESS_TOKEN}",
    "MEMOIRE_ENV": "development"
  }
}
  • remoteEnv forwards FIGMA_ACCESS_TOKEN from host shell — set once in .zshrc/.bashrc, never committed.
  • VS Code auto-forwards ports in forwardPorts. The Figma plugin connects to localhost:9223 on the host; VS Code tunnels it into the container transparently.

7. Environment Variables Reference

VariableDefaultPurpose
MEMOIRE_HEADLESSfalseDisables interactive TUI, uses JSON output
MEMOIRE_NO_BRIDGEfalseSkips Figma bridge discovery entirely
MEMOIRE_ENVdevelopmentdevelopment, ci, production
MEMOIRE_MCP_PORT4402Port for MCP HTTP transport
MEMOIRE_PREVIEW_PORT4400Port for preview server
MEMOIRE_DASHBOARD_PORT4401Port for dashboard server
MEMOIRE_BRIDGE_HOST0.0.0.0Host to bind the WebSocket bridge listener
MEMOIRE_AGENT_ROLEgeneralRole for a spawned agent worker
FIGMA_ACCESS_TOKEN—Figma REST API token (required for memi pull)

Set in .env for local dev (never commit). Use Docker secrets or CI environment for production.


8. .memoire/project.json Docker Block

json
{
  "docker": {
    "enabled": true,
    "mode": "dev",
    "bridge": {
      "host": "0.0.0.0",
      "portRange": [9223, 9232],
      "fallbackHost": "host.docker.internal"
    },
    "preview": { "host": "0.0.0.0", "port": 4400 },
    "ci": {
      "headless": true,
      "noBridge": true,
      "exitOnAuditError": true,
      "failOnWarn": false
    },
    "mcp": { "shared": true, "host": "memoire.internal", "port": 4402 }
  }
}
FieldDefaultDescription
docker.modedevdev, ci, or mcp
bridge.fallbackHosthost.docker.internalFallback for Docker Desktop on Mac/Win
ci.failOnWarnfalseExit non-zero on audit warnings
mcp.sharedfalseUse shared remote MCP server

9. Anti-Patterns

Never: Run bridge exclusively in Docker for canvas work

Every canvas op adds a port-forward round trip. Run Mémoire on the host for design-heavy sessions.

Never: Use root user in production containers

dockerfile
# Bad
CMD ["node", "dist/cli.js"]

# Good
RUN addgroup -S memoire && adduser -S memoire -G memoire
USER memoire
CMD ["node", "dist/cli.js"]

Never: Bake .memoire/ into the image

Mount it as a volume. Baking it in means every spec change requires a rebuild.

dockerfile
VOLUME ["/workspace/.memoire"]

Never: Bind preview server to 127.0.0.1 in containers

Set MEMOIRE_PREVIEW_HOST=0.0.0.0 or configure via .memoire/project.json.

Never: Hardcode FIGMA_ACCESS_TOKEN in docker-compose.yml

yaml
# Bad
environment: [FIGMA_ACCESS_TOKEN=figd_abc123...]

# Good — read from host env
environment: [FIGMA_ACCESS_TOKEN=${FIGMA_ACCESS_TOKEN}]

# Production — Docker secrets
secrets:
  figma_token: { external: true }
services:
  memoire-mcp:
    secrets: [figma_token]
    environment: [FIGMA_ACCESS_TOKEN_FILE=/run/secrets/figma_token]

Never: Skip health checks on agent workers

Dead workers stall the task queue. The heartbeat timeout is 30s. Always add health checks and restart: on-failure.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Docker Environments AI skill do?

Docker-aware Mémoire operation — CI/CD headless pipelines, shared MCP server, agent worker containers, and Figma bridge port-forwarding for containerized setups

Why use Docker Environments on TypingMind?

Because you install it once and use it with any model. Docker Environments is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Docker Environments in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/memi-design/design-skills/tree/main/skills/docker-environments. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Docker Environments?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Docker Environments?

As many as you like. As long as a model supports skills, you can use Docker Environments with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Docker Environments AI skill free?

Yes. It is published on GitHub by memi-design under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇