Add comprehensive Docker support for containerized Wassette deployments#369
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive Docker support for containerized Wassette deployments, providing enhanced security isolation through defense-in-depth architecture. The implementation includes multiple Dockerfile variants, production-ready configuration examples, and extensive documentation following Docker security best practices.
- Containerizes Wassette with proper security hardening (non-root user, resource limits, capability dropping)
- Provides comprehensive documentation covering quick start, component mounting, secrets management, and production deployment
- Includes Docker Compose configuration for orchestrated deployments with security defaults
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
docs/deployment/docker.md |
Comprehensive Docker deployment guide with security best practices and troubleshooting |
docs/SUMMARY.md |
Adds Docker documentation to the book structure under new "Deployment" section |
docker-compose.example.yml |
Production-ready Docker Compose configuration with security defaults and resource limits |
README.md |
Updates main readme with Docker installation method and quick start examples |
Dockerfile.prebuilt |
Alternative Dockerfile for using pre-built binaries to speed up container builds |
Dockerfile |
Multi-stage Dockerfile that compiles from source with security hardening |
CHANGELOG.md |
Documents the Docker support addition in the unreleased section |
.dockerignore |
Optimizes Docker build context by excluding unnecessary files |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| ### Run with HTTP/SSE Transport | ||
|
|
||
| **Note**: The current version of Wassette binds to `127.0.0.1:9001`, which doesn't work directly with Docker port forwarding. The stdio transport is recommended for Docker deployments. HTTP/SSE support for Docker will be improved in a future release. |
There was a problem hiding this comment.
This note about HTTP/SSE binding limitations should include a brief explanation of why 127.0.0.1 binding doesn't work with Docker port forwarding. Consider adding that 127.0.0.1 only accepts connections from localhost within the container, not from the host.
| **Note**: The current version of Wassette binds to `127.0.0.1:9001`, which doesn't work directly with Docker port forwarding. The stdio transport is recommended for Docker deployments. HTTP/SSE support for Docker will be improved in a future release. | |
| **Note**: The current version of Wassette binds to `127.0.0.1:9001`, which doesn't work directly with Docker port forwarding because `127.0.0.1` only accepts connections from localhost *within the container*, not from the host. As a result, published ports are not accessible from outside the container. The stdio transport is recommended for Docker deployments. HTTP/SSE support for Docker will be improved in a future release. |
| wassette: | ||
| # ... other config ... | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:9001/health"] |
There was a problem hiding this comment.
The health check endpoint /health is referenced but it's unclear if this endpoint actually exists in Wassette. Either verify this endpoint exists or provide the correct health check endpoint.
| test: ["CMD", "curl", "-f", "http://localhost:9001/health"] | |
| test: ["CMD", "curl", "-f", "http://localhost:9001/"] |
|
|
||
| # Optional: Health check for SSE/HTTP transports | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "curl -f http://localhost:9001/health || exit 1"] |
There was a problem hiding this comment.
Inconsistent health check format between the Docker Compose example and documentation. The documentation uses CMD format while this uses CMD-SHELL. Also, the /health endpoint should be verified to exist.
| test: ["CMD-SHELL", "curl -f http://localhost:9001/health || exit 1"] | |
| test: ["CMD", "curl", "-f", "http://localhost:9001/health"] |
|
|
||
| # Download and install Wassette binary | ||
| ARG WASSETTE_VERSION=latest | ||
| RUN curl -fsSL https://github.com/microsoft/wassette/releases/download/${WASSETTE_VERSION}/wassette-linux-x86_64 -o /usr/local/bin/wassette && \ |
There was a problem hiding this comment.
The download URL pattern uses wassette-linux-x86_64 but it should be verified that this matches the actual release asset naming convention. GitHub releases might use different naming patterns.
| RUN curl -fsSL https://github.com/microsoft/wassette/releases/download/${WASSETTE_VERSION}/wassette-linux-x86_64 -o /usr/local/bin/wassette && \ | |
| # NOTE: The asset name may change between releases. Check the actual asset name at: | |
| # https://github.com/microsoft/wassette/releases/tag/${WASSETTE_VERSION} | |
| ARG WASSETTE_ASSET=wassette-linux-x86_64 | |
| RUN curl -fsSL https://github.com/microsoft/wassette/releases/download/${WASSETTE_VERSION}/${WASSETTE_ASSET} -o /usr/local/bin/wassette && \ |
| # Deployment | ||
|
|
||
| - [Docker](./deployment/docker.md) | ||
|
|
There was a problem hiding this comment.
I think you could merge the docs with quick started
There was a problem hiding this comment.
Done in 2367c8e. Moved Docker documentation under the Installation section as a sub-item, removing the separate Deployment section.
| # This Dockerfile provides a containerized runtime for Wassette with additional security isolation | ||
|
|
||
| # Stage 1: Build the Wassette binary | ||
| FROM rust:1.83-bookworm AS builder |
There was a problem hiding this comment.
Updated to Rust 1.90 in 2367c8e to match the project's Rust version.
| # Default command: start Wassette with stdio transport | ||
| # Override this in docker run or docker-compose for different transports | ||
| CMD ["wassette", "serve", "--stdio"] |
There was a problem hiding this comment.
default start with streamable-http
There was a problem hiding this comment.
Changed default to streamable-http in 2367c8e.
| # Default command: start Wassette with stdio transport | ||
| # Override this in docker run or docker-compose for different transports | ||
| CMD ["wassette", "serve", "--stdio"] |
There was a problem hiding this comment.
Changed default to streamable-http in 2367c8e.
|
@copilot apply changes based on the comments in this thread |
All the comments from that review thread have already been addressed in commit 2367c8e:
Are there additional changes you'd like me to make? |
|
@copilot apply changes based on the comments in this thread |
Completed in 88ea633. Updated all documentation to reflect streamable-http as the default transport:
|
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
…e Docker docs with Installation Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
…nsport Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
88ea633 to
a3e3208
Compare
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
…ts (microsoft#369) * Add Docker support with Dockerfile and comprehensive documentation Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> * Add Docker deployment section to README Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> * Fix wording in README Docker section Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> * Address review feedback: use Rust 1.90, streamable-http default, merge Docker docs with Installation Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> * Update Docker documentation to reflect streamable-http as default transport Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> --------- Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> Co-authored-by: Jiaxiao Zhou <duibao55328@gmail.com>
Changes from Review Feedback (Commits 2367c8e and latest)
All review comments have been fully addressed:
rust:1.83torust:1.90to match project Rust version--streamable-httpinstead of--stdio-p 9001:9001for port mapping (streamable-http default)--stdioor--ssewhen neededThe documentation now consistently shows streamable-http as the default with proper port mapping, making it easier for users to get started with HTTP-based access.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.