[GH-ISSUE #225] Docker/Docker Compose support for self-hosting #89

Closed
opened 2026-03-01 14:39:59 +03:00 by kerem · 1 comment
Owner

Originally created by @jedyskate on GitHub (Jan 1, 2026).
Original GitHub issue: https://github.com/arikchakma/maily.to/issues/225

Problem Statement

Currently, there is no official Docker image or docker-compose configuration for deploying maily.to in production environments. The project only provides development setup instructions (pnpm dev), which makes it difficult for users who want to self-host the application.

Current State

What exists:

  • Development setup documentation (pnpm install & pnpm dev)
  • NPM packages for library usage (@maily-to/core, @maily-to/render)

What's missing:

  • Docker image (official or community-maintained)
  • docker-compose.yml configuration
  • Production deployment documentation
  • Example production configuration
  • Dockerfile reference implementation

Use Case

Many users want to self-host maily.to for:

  • Privacy/data sovereignty
  • Custom branding
  • Integration with existing infrastructure
  • Air-gapped/on-premise deployments
  • Cost optimization

Technical Challenges Encountered

While attempting to create a custom Docker setup, several non-obvious challenges were encountered:

  1. Vercel Preset Incompatibility: The react-router.config.ts uses vercelPreset() which creates a serverless build structure incompatible with standard Node.js deployment (outputs to nodejs_eyJydW50aW1lIjoibm9kZWpzIn0/index.js instead of index.js)

  2. Monorepo Build Order: Building requires pnpm build --filter=@maily-to/web... to ensure workspace dependencies (@maily-to/render, @maily-to/core) are built first

  3. React Router v7 Server: Starting the production server requires understanding React Router v7's build output structure and proper invocation

  4. No Production Examples: Without official guidance, users must reverse-engineer the deployment process

Suggested Solution

Provide one or more of the following:

Option 1: Official Docker Image

# Example usage
services:
  maily:
    image: ghcr.io/arikchakma/maily.to:latest
    environment:
      - VITE_SUPABASE_URL=https://your-project.supabase.co
      - VITE_SUPABASE_ANON_KEY=your-anon-key
      - VITE_APP_URL=https://maily.example.com
    ports:
      - "3000:3000"

Option 2: Reference Dockerfile

Add a production-ready Dockerfile to the repository with:

  • Multi-stage build
  • Proper handling of monorepo workspace
  • Standard Node.js build (non-Vercel preset)
  • Production optimizations

Option 3: Docker Compose Template

Provide a docker-compose.yml template showing:

  • Complete environment variable configuration
  • Integration with Supabase (or self-hosted alternative)
  • Reverse proxy setup (Traefik/nginx)
  • Volume mounts for persistence

Option 4: Deployment Documentation

Add a deployment guide covering:

  • How to build for production
  • Environment variable configuration
  • Server requirements
  • Reverse proxy setup
  • SSL/HTTPS configuration

Additional Context

Technology Stack:

  • React Router v7
  • Supabase (authentication)
  • Vite (build tool)
  • pnpm workspaces (monorepo)

Similar Projects:
Many open-source projects provide Docker support out of the box:

  • Cal.com - includes Dockerfile and docker-compose
  • Plausible - official Docker images
  • Appsmith - comprehensive Docker documentation

Workarounds

For others attempting to self-host, here's a working approach:

  1. Remove Vercel preset from react-router.config.ts for standard builds
  2. Use pnpm build --filter=@maily-to/web... to build all workspace dependencies
  3. Start with node ./build/server/index.js or React Router's serve command

Proposed Labels

  • enhancement
  • documentation
  • deployment
  • help wanted

Would maintainers be open to contributions in this area? Happy to submit a PR with a working Docker setup if there's interest.

Originally created by @jedyskate on GitHub (Jan 1, 2026). Original GitHub issue: https://github.com/arikchakma/maily.to/issues/225 ## Problem Statement Currently, there is no official Docker image or docker-compose configuration for deploying maily.to in production environments. The project only provides development setup instructions (`pnpm dev`), which makes it difficult for users who want to self-host the application. ## Current State **What exists:** - ✅ Development setup documentation (`pnpm install` & `pnpm dev`) - ✅ NPM packages for library usage (`@maily-to/core`, `@maily-to/render`) **What's missing:** - ❌ Docker image (official or community-maintained) - ❌ `docker-compose.yml` configuration - ❌ Production deployment documentation - ❌ Example production configuration - ❌ Dockerfile reference implementation ## Use Case Many users want to self-host maily.to for: - Privacy/data sovereignty - Custom branding - Integration with existing infrastructure - Air-gapped/on-premise deployments - Cost optimization ## Technical Challenges Encountered While attempting to create a custom Docker setup, several non-obvious challenges were encountered: 1. **Vercel Preset Incompatibility**: The `react-router.config.ts` uses `vercelPreset()` which creates a serverless build structure incompatible with standard Node.js deployment (outputs to `nodejs_eyJydW50aW1lIjoibm9kZWpzIn0/index.js` instead of `index.js`) 2. **Monorepo Build Order**: Building requires `pnpm build --filter=@maily-to/web...` to ensure workspace dependencies (`@maily-to/render`, `@maily-to/core`) are built first 3. **React Router v7 Server**: Starting the production server requires understanding React Router v7's build output structure and proper invocation 4. **No Production Examples**: Without official guidance, users must reverse-engineer the deployment process ## Suggested Solution Provide one or more of the following: ### Option 1: Official Docker Image ```yaml # Example usage services: maily: image: ghcr.io/arikchakma/maily.to:latest environment: - VITE_SUPABASE_URL=https://your-project.supabase.co - VITE_SUPABASE_ANON_KEY=your-anon-key - VITE_APP_URL=https://maily.example.com ports: - "3000:3000" ``` ### Option 2: Reference Dockerfile Add a production-ready `Dockerfile` to the repository with: - Multi-stage build - Proper handling of monorepo workspace - Standard Node.js build (non-Vercel preset) - Production optimizations ### Option 3: Docker Compose Template Provide a `docker-compose.yml` template showing: - Complete environment variable configuration - Integration with Supabase (or self-hosted alternative) - Reverse proxy setup (Traefik/nginx) - Volume mounts for persistence ### Option 4: Deployment Documentation Add a deployment guide covering: - How to build for production - Environment variable configuration - Server requirements - Reverse proxy setup - SSL/HTTPS configuration ## Additional Context **Technology Stack:** - React Router v7 - Supabase (authentication) - Vite (build tool) - pnpm workspaces (monorepo) **Similar Projects:** Many open-source projects provide Docker support out of the box: - [Cal.com](https://github.com/calcom/cal.com) - includes Dockerfile and docker-compose - [Plausible](https://github.com/plausible/analytics) - official Docker images - [Appsmith](https://github.com/appsmithorg/appsmith) - comprehensive Docker documentation ## Workarounds For others attempting to self-host, here's a working approach: 1. Remove Vercel preset from `react-router.config.ts` for standard builds 2. Use `pnpm build --filter=@maily-to/web...` to build all workspace dependencies 3. Start with `node ./build/server/index.js` or React Router's serve command ## Proposed Labels - `enhancement` - `documentation` - `deployment` - `help wanted` --- Would maintainers be open to contributions in this area? Happy to submit a PR with a working Docker setup if there's interest.
kerem closed this issue 2026-03-01 14:39:59 +03:00
Author
Owner

@arikchakma commented on GitHub (Jan 13, 2026):

I am already working on the rewrite, I will add it in there probably. I will keep it in backlog.

<!-- gh-comment-id:3745569484 --> @arikchakma commented on GitHub (Jan 13, 2026): I am already working on the rewrite, I will add it in there probably. I will keep it in backlog.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/maily.to#89
No description provided.