This document covers the secondary runtime paths for all-Mail.
- Use
docs/DEPLOY.mdfor the canonical Docker-first deployment path. - Use
docs/ENVIRONMENT.mdfor variable meaning and template ownership. - Use
docs/RUNBOOK.mdfor troubleshooting and recovery. - Use this file only when you intentionally run the compiled app outside the main Docker app container.
Use this guide only when you need one of these advanced modes:
- run the app itself outside Docker
- keep PostgreSQL / Redis in Docker but run the app from source
- use the repository-level
all-mailCLI for source-based startup
If you just want the supported default path, go back to the root README.md and use Docker Compose.
Direct npm/CLI runtime still expects external infrastructure:
| Dependency | Required | Why |
|---|---|---|
| PostgreSQL | Yes | DATABASE_URL is mandatory in server/src/config/env.ts, and startup exits if Prisma cannot connect |
| Redis | Recommended | REDIS_URL is optional, but degraded Redis affects caching, OAuth state, and rate-limit behavior |
You also need a real env file.
Env resolution order for scripts/start-all-mail.mjs and bin/all-mail.mjs is:
ALL_MAIL_ENV_FILEserver/.env- repo-root
.env
Important derivations:
APP_PORTcan populatePORTwhenPORTis absent.POSTGRES_*can be used to deriveDATABASE_URL.REDIS_*can be used to deriveREDIS_URL.- Login URL output resolves
PUBLIC_BASE_URL->ALL_MAIL_PUBLIC_BASE_URL-> firstCORS_ORIGINentry -> localhost fallback.
Keep PostgreSQL + Redis in Docker, but run the app from source:
docker compose up -d postgres redis
./bin/all-mail install
./bin/all-mail build
./bin/all-mail startThis is the simplest non-default path when you want app logs and source control outside the app container while still using Compose for dependencies.
If PostgreSQL and Redis already exist outside Docker:
cp server/.env.example server/.env
./bin/all-mail install
./bin/all-mail build
./bin/all-mail startIf you keep the default PORT=3000, the callback URI defaults in server/.env.example already match that source-runtime port. If you change PORT, update the provider OAuth callback URIs in the same file as well.
You can install the repository as a source-based global CLI from a local clone:
npm install -g /path/to/all-MailCommon commands:
all-mail setup
all-mail install
all-mail build
all-mail doctor --env-file /path/to/.env
all-mail deps up
all-mail up --docker-deps --env-file /path/to/.env --port 3102
all-mail start --env-file /path/to/.env --port 3102
all-mail deploy --env-file /path/to/.env --port 3102
all-mail checkIf you want the app outside Docker, but still want PostgreSQL + Redis prepared automatically:
all-mail up --docker-deps --env-file /path/to/.env --port 3102That command:
- runs
docker compose up -d postgres redis - installs/builds the app only if required artifacts are missing
- starts
all-Mailthrough the same source-runtime path
Source-runtime-specific readiness check:
all-mail doctor --env-file /path/to/.envRepo-root verification entrypoints remain the canonical release contract when you are working from the repository:
./bin/all-mail doctor
./bin/all-mail check./bin/all-mail doctorchecks env resolution, PostgreSQL reachability, Redis reachability, and required build artifacts../bin/all-mail checkruns the full local release gate, including production dependency audits.- If your shell exports
NODE_USE_ENV_PROXYorHTTP[S]_PROXY, these./bin/all-mail ...entrypoints avoid noisyUNDICI-EHPAstartup warnings by sanitizing the env before Node/npm bootstraps.
Basic HTTP health probe after startup:
curl http://127.0.0.1:3000/healthIf you changed PORT, replace 3000 accordingly.
./bin/all-mail install→ installs nestedserver,web, and worker dependencies through the sanitized CLI wrapper./bin/all-mail build→ buildsserver, buildsweb, and copiesweb/distinto repo-rootpublic/./bin/all-mail start→ starts the compiled server and reuses the same Prisma migration fallback logic as the Docker entrypoint./bin/all-mail deploy→ convenience wrapper forbuild + start
scripts/start-all-mail.mjsfollows the same Prisma migration/deploy fallback behavior asdocker/entrypoint.sh.- Bootstrap-generated secrets default to
.all-mail-runtime/bootstrap-secrets.envfor the source runtime. ExportALL_MAIL_STATE_DIRbefore launch if you need the bootstrap-secret file written elsewhere; setting it only inside the env file affects later child runtimes but not the initial bootstrap-secret write. P3009is not auto-recovered. Treat it as a manual recovery event and usedocs/RUNBOOK.md.
This is still a source-based runtime, not a zero-dependency desktop-style package. You are responsible for env configuration and for keeping PostgreSQL / Redis reachable outside the all-Mail process.