Docker Containerization Support for Evolution SDK#6
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a complete, production-grade Docker containerization setup for the Evolution SDK. The goal is to eliminate the "works on my machine" problem by giving contributors and end-users a reproducible, isolated environment that mirrors production — without requiring manual installation of Node.js, pnpm, or TypeScript.
Description
Setting up the Evolution SDK locally requires specific versions of Node.js, pnpm, and TypeScript, which can be inconsistent across developer machines and CI environments.
This PR solves that by containerizing the entire SDK workflow — from development with hot reload, to testing and documentation serving, to a minimal production runtime image.
It also lays the groundwork for future CI/CD pipelines and significantly improves onboarding for new contributors.
📁 Files Added
base → development → builder → productionteststage,HEALTHCHECK, and build-arg supportDockerfile.docsdocker-help.sh🛠️ Implementation Details
Multi-Stage Dockerfile (Dockerfile / [Dockerfile.multi]
primary uses a carefully layered multi-stage build:
node:20-alpine (base) ├── corepack + pnpm via corepack (no npm install -g) Minimal Alpine system packages: git, bash, curl, jq
Lockfile-first COPY for optimal layer caching ├── pnpm install --frozen-lockfile (cached via --mount=type=cache) └── pnpm turbo build --filter=@evolution-sdk/* ├── development → pnpm turbo dev (hot reload) ├── test → pnpm turbo test (CI runner) └── builder → pnpm prune --prod └── production → ~200MB minimal runtime image
Key design decisions:
--mount=type=cache,id=pnpm) dramatically speed up repeated builds by reusing the pnpm store across buildsCOPY pnpm-lock.yaml ... ./before source code means dependency layers are only invalidated when dependencies changepnpm prune --prodin the builder stage removes all devDependencies before copying into the slim production imagenode:20-alpineas the base keeps images lean — production image is ~200MB vs ~800MB for developmentDocker Compose (docker-compose.yml)
Four services managed together:
evolution-devevolution-docsevolution-testpnpm turbo test, exits on completioncardano-devnetevolution-devpreservenode_modulesinside the container while reflecting live source edits from the host (./packages:/app/packages).Script
Build Script (docker-build.sh)
A colored, idiomatic bash script wrapping all Docker commands: