@fabioplunser/epd 0.5.17 → 0.5.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -14
- package/bin/epd.js +0 -0
- package/dist/cli.js +363 -132
- package/package.json +15 -29
- package/docs/.vitepress/config.mts +0 -92
- package/docs/.vitepress/theme/DeployAnimation.vue +0 -989
- package/docs/.vitepress/theme/index.ts +0 -10
- package/docs/.vitepress/theme/style.css +0 -151
- package/docs/agents.md +0 -166
- package/docs/ci-cd.md +0 -152
- package/docs/getting-started.md +0 -296
- package/docs/guide/accessories.md +0 -103
- package/docs/guide/architecture.md +0 -94
- package/docs/guide/blue-green.md +0 -93
- package/docs/guide/dashboard-validation.md +0 -181
- package/docs/guide/deployment-modes.md +0 -135
- package/docs/guide/getting-started.md +0 -296
- package/docs/guide/high-availability.md +0 -89
- package/docs/guide/installation.md +0 -124
- package/docs/guide/multi-site.md +0 -101
- package/docs/guide/private-repositories.md +0 -44
- package/docs/guide/routing.md +0 -129
- package/docs/guide/secrets.md +0 -132
- package/docs/guide/server-baseline.md +0 -104
- package/docs/guide/storage-validation.md +0 -40
- package/docs/guide/troubleshooting.md +0 -113
- package/docs/guide.md +0 -150
- package/docs/hetzner-dns.md +0 -95
- package/docs/index.md +0 -44
- package/docs/public/CNAME +0 -1
- package/docs/public/favicon.svg +0 -52
- package/docs/public/llms-full.txt +0 -344
- package/docs/public/llms.txt +0 -43
- package/docs/reference/cli.md +0 -510
- package/docs/reference/config.md +0 -237
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
# Dashboard validation
|
|
2
|
-
|
|
3
|
-
The local unit/contract suites and a production build are useful checks, but do
|
|
4
|
-
not prove that SSH deployment, server startup after reboot, or provider
|
|
5
|
-
authentication works. Keep those results separate in `log.md`.
|
|
6
|
-
|
|
7
|
-
## Portable checks
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
bun install --frozen-lockfile
|
|
11
|
-
bun run typecheck
|
|
12
|
-
bun test
|
|
13
|
-
bun run web:check
|
|
14
|
-
bun run web:build:verify
|
|
15
|
-
bun run web:bundles
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
The Bash health-probe, fake OpenSSH transport and retention-entrypoint fixtures
|
|
19
|
-
execute POSIX programs locally. They are explicitly skipped on Windows and run
|
|
20
|
-
on the appropriate Linux/macOS CI jobs. Logging subprocess tests are portable.
|
|
21
|
-
Windows still runs dashboard authorization, database, storage transport,
|
|
22
|
-
OAuth/Git credential, job-recovery and SSE regression tests.
|
|
23
|
-
|
|
24
|
-
The build-isolation wrapper checks that route analysis does not create or modify
|
|
25
|
-
the configured runtime database paths. Bundle measurements are a cold-cache
|
|
26
|
-
estimate, not a Lighthouse score. Set `EPD_MAX_ROUTE_JS_GZIP_KB` to enforce an
|
|
27
|
-
explicit measured route budget; no unmeasured 100 KB claim is made.
|
|
28
|
-
|
|
29
|
-
The isolated Linux helper verifies a complete source/test inventory before
|
|
30
|
-
running tests, and refuses to build a stale saved snapshot:
|
|
31
|
-
|
|
32
|
-
```sh
|
|
33
|
-
bash scripts/validate-linux.sh
|
|
34
|
-
bash scripts/validate-linux.sh --build-existing /tmp/epd-linux-validation.REPORTED_ID
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
The first command prints its actual temporary directory. The second resumes
|
|
38
|
-
that directory only when its source and tests still match the workspace. Start
|
|
39
|
-
a fresh run after changing source. Local environment files and logs are excluded
|
|
40
|
-
from the copied tree.
|
|
41
|
-
|
|
42
|
-
## Docker on Windows
|
|
43
|
-
|
|
44
|
-
Start Docker Desktop with its Linux engine and confirm `docker info` succeeds.
|
|
45
|
-
Run the Linux shell harnesses from a Linux environment, such as an integrated
|
|
46
|
-
WSL distribution. Use a copy of the **current working tree**: cloning the remote
|
|
47
|
-
repository will omit uncommitted implementation changes. Install Linux
|
|
48
|
-
dependencies in that copy; do not reuse Windows `node_modules` links.
|
|
49
|
-
|
|
50
|
-
```sh
|
|
51
|
-
bun run web:test:e2e
|
|
52
|
-
bun scripts/alloy-config-e2e.ts
|
|
53
|
-
sh deploy/console/test/run.sh
|
|
54
|
-
bash deploy/console/test/features-e2e.sh
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
The deployment harness creates a uniquely named privileged Docker-in-Docker
|
|
58
|
-
fixture. Its nested Docker daemon isolates EPD's proxy/container names from
|
|
59
|
-
normal host workloads. The fixture is disposable, with scoped cleanup and
|
|
60
|
-
diagnostics in `test-results/`. Read `test/web-e2e/README.md` for scenario details.
|
|
61
|
-
|
|
62
|
-
For credential-free local S3 authentication and PostgreSQL restoration through
|
|
63
|
-
stored objects, follow [local S3 wire validation](storage-validation.md). This
|
|
64
|
-
uses a signature-validating disposable server and the actual storage adapter.
|
|
65
|
-
|
|
66
|
-
A container restart is not a real machine reboot. Container tests do not close
|
|
67
|
-
the reboot validation item.
|
|
68
|
-
|
|
69
|
-
## Disposable VM and reboot validation
|
|
70
|
-
|
|
71
|
-
An Ubuntu Server 24.04 Hyper-V VM is suitable. A suggested small test allocation
|
|
72
|
-
is 2 vCPUs, 4 GB RAM and a 30 GB disk. Enable SSH, use a dedicated key and a
|
|
73
|
-
passwordless-sudo test user, and make the VM reachable from the control plane.
|
|
74
|
-
Take a VM checkpoint before enrollment. Keep this VM isolated from production
|
|
75
|
-
resources; enrollment changes its packages, services and deployment runtime.
|
|
76
|
-
|
|
77
|
-
### Ubuntu 22.04 Hyper-V desktop login failure
|
|
78
|
-
|
|
79
|
-
Ubuntu 22.04 LTS can also be used for the disposable test. If Virtual Machine
|
|
80
|
-
Connection shows `login failed for display 0`, the guest is running but its
|
|
81
|
-
enhanced desktop session failed. Try **View → Enhanced Session** (uncheck it)
|
|
82
|
-
and log in through the basic console. This is a
|
|
83
|
-
[documented Ubuntu 22.04 workaround](https://learn.microsoft.com/en-us/answers/questions/1083412/problem-with-ubunti-22-04-on-hyper-v),
|
|
84
|
-
not proof of a networking failure. If basic login works, close any existing
|
|
85
|
-
desktop session before retrying enhanced login and check the guest's xrdp logs
|
|
86
|
-
if it still fails.
|
|
87
|
-
|
|
88
|
-
From the guest console, enable SSH and find the guest address:
|
|
89
|
-
|
|
90
|
-
```sh
|
|
91
|
-
sudo apt update
|
|
92
|
-
sudo apt install -y openssh-server
|
|
93
|
-
sudo systemctl enable --now ssh
|
|
94
|
-
hostname -I
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
See [Ubuntu's OpenSSH instructions](https://ubuntu.com/server/docs/how-to/security/openssh-server/).
|
|
98
|
-
If UFW is enabled, allow the OpenSSH profile (`sudo ufw allow OpenSSH`). From
|
|
99
|
-
Windows, check `Test-NetConnection VM_ADDRESS -Port 22`. If it fails, check the
|
|
100
|
-
VM network adapter has a connected virtual switch and the guest has a reachable
|
|
101
|
-
address. Desktop session login and SSH are separate connections.
|
|
102
|
-
|
|
103
|
-
Store the dedicated SSH key and a host alias in local SSH configuration, then
|
|
104
|
-
provide only the alias/configuration path. Verify the host fingerprint against
|
|
105
|
-
the guest console before enrollment. Hyper-V inventory commands may require an
|
|
106
|
-
administrator or Hyper-V Administrators membership; a denied inventory query
|
|
107
|
-
does not establish whether the VM is reachable over SSH.
|
|
108
|
-
|
|
109
|
-
1. Enroll the VM through the dashboard. Compare its SSH fingerprint against the
|
|
110
|
-
VM console before approving installation.
|
|
111
|
-
2. Deploy the disposable test project and verify its served content and logs.
|
|
112
|
-
3. Reboot **the Linux VM**, then verify application content, Docker/Traefik,
|
|
113
|
-
CrowdSec, Alloy, WireGuard, metrics/log arrival and retained operation history.
|
|
114
|
-
4. Exercise interrupted enrollment and removal on disposable checkpoints. Record
|
|
115
|
-
failures, recovery steps and actual outcomes; do not infer success from a job
|
|
116
|
-
merely being queued.
|
|
117
|
-
|
|
118
|
-
The database and named-volume archive drills require explicit local environment configuration. Store
|
|
119
|
-
paths to keys and known-hosts files in these variables, never key contents in
|
|
120
|
-
chat or the repository:
|
|
121
|
-
|
|
122
|
-
```sh
|
|
123
|
-
export EPD_DATABASE_E2E_HOST=VM_ADDRESS
|
|
124
|
-
export EPD_DATABASE_E2E_USER=TEST_USER
|
|
125
|
-
export EPD_DATABASE_E2E_KEY=/private/path/test_key
|
|
126
|
-
export EPD_DATABASE_E2E_KNOWN_HOSTS=/private/path/known_hosts
|
|
127
|
-
bun scripts/database-e2e.ts
|
|
128
|
-
bun scripts/archive-e2e.ts
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
It creates a uniquely named PostgreSQL container/volume, checks archived row
|
|
132
|
-
integrity, rejects a corrupt archive before changing data, checks removal of
|
|
133
|
-
post-snapshot objects and cleans up that fixture. It modifies the specified
|
|
134
|
-
machine and must target a disposable test host. Automatic SQL replacement is
|
|
135
|
-
limited to supported schema-based PostgreSQL databases; complex extensions,
|
|
136
|
-
large objects, replication, event triggers, foreign servers and custom default
|
|
137
|
-
privileges require an operator-managed restore. This is snapshot restore, not
|
|
138
|
-
point-in-time recovery.
|
|
139
|
-
|
|
140
|
-
Project volume archives support declared Docker accessory named volumes. They
|
|
141
|
-
stop the owning accessory while streaming and restore its previous running
|
|
142
|
-
state afterward. Database images require logical backups, and shared running
|
|
143
|
-
writers, bind mounts and process projects are refused. Restore verifies the
|
|
144
|
-
recorded target and checksum, uploads a protection backup and stages replacement.
|
|
145
|
-
Links, special files and unsafe paths are refused before replacing data. If
|
|
146
|
-
rollback cannot complete, recovery files are retained for operator inspection.
|
|
147
|
-
Schedules require explicit administrator policy and `EPD_BACKUP_SCHEDULER=1`.
|
|
148
|
-
Storage bucket/location cannot change under an existing integration; access-key
|
|
149
|
-
rotation is supported. Referenced integrations cannot be deleted while archives
|
|
150
|
-
depend on them.
|
|
151
|
-
|
|
152
|
-
## Provider and sharing checks
|
|
153
|
-
|
|
154
|
-
- Save R2/Wasabi credentials through Integrations, then explicitly authorize its
|
|
155
|
-
random-object verification job. Only a successful write/read/checksum/delete
|
|
156
|
-
result verifies the target. Enable a database backup policy separately. The
|
|
157
|
-
installation scheduler remains off unless `EPD_BACKUP_SCHEDULER=1`.
|
|
158
|
-
- Restore from the backup page requires administrator access and the exact
|
|
159
|
-
target database name. The job verifies the stored checksum and takes a
|
|
160
|
-
protection backup before mutation. Verify restored data independently.
|
|
161
|
-
- Follow [private repository setup](private-repositories.md) to register the
|
|
162
|
-
GitHub App/GitLab OAuth application. Test both an authorized private clone and
|
|
163
|
-
rejected repositories/organizations. Fixture API tests do not prove provider
|
|
164
|
-
authorization.
|
|
165
|
-
- Billing checkout never activates a subscription by itself. Test signed
|
|
166
|
-
provider webhooks and customer portal behavior with configured Stripe test
|
|
167
|
-
credentials. Existing pricing/business policy still requires owner review.
|
|
168
|
-
- AI guidance is disabled unless `EPD_AI_PROVIDER=openai`, `EPD_AI_MODEL` and
|
|
169
|
-
`OPENAI_API_KEY` are explicitly configured. An organization administrator must
|
|
170
|
-
enable sharing, and each request requires review/confirmation of the redacted
|
|
171
|
-
excerpt. Model output is guidance only and has no execution tools. Requests
|
|
172
|
-
use `store:false`; provider retention policies still apply. No model is
|
|
173
|
-
selected automatically. The adapter follows the
|
|
174
|
-
[official OpenAI text-generation documentation](https://developers.openai.com/api/docs/guides/text).
|
|
175
|
-
|
|
176
|
-
## Current release gates
|
|
177
|
-
|
|
178
|
-
Record the final check counts, runtime versions, build result and bundle report
|
|
179
|
-
in `log.md`. Record live Linux, reboot, restore and provider checks separately.
|
|
180
|
-
The managed-cloud stack/OpenTofu/domain/PITR work follows the self-hosted release
|
|
181
|
-
gate and the design/business decisions listed in `plans/`.
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
# Deployment Modes: Docker vs. Process
|
|
2
|
-
|
|
3
|
-
`epd` supports two distinct deployment runtimes configured via the top-level `mode` field: **Docker** and **Process (PM2)**.
|
|
4
|
-
|
|
5
|
-
Both modes share the exact same blue/green zero-downtime guarantees, Traefik SSL routing, health checks, and instant rollbacks.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Quick Comparison
|
|
10
|
-
|
|
11
|
-
| Feature | Docker Mode (`mode: docker`) | Process Mode (`mode: process`) |
|
|
12
|
-
|---|---|---|
|
|
13
|
-
| **Best For** | Multi-language apps, containers, microservices | Ultra-low RAM VPS, Bun/Node/Python apps |
|
|
14
|
-
| **Server Requirements** | Docker Engine installed | Node.js/Bun, PM2, and `rsync` |
|
|
15
|
-
| **Container Overhead** | Minimal (~20-40MB per container) | **Zero container overhead** |
|
|
16
|
-
| **Build Location** | Local machine or CI runner | Remote server (or pre-built artifact) |
|
|
17
|
-
| **Image Registry** | Optional (can stream over SSH) | None needed |
|
|
18
|
-
| **Process Manager** | Docker Engine daemon | PM2 process supervisor |
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## 1. Docker Mode (Default)
|
|
23
|
-
|
|
24
|
-
In Docker mode, your application is packaged as an OCI/Docker container image.
|
|
25
|
-
|
|
26
|
-
```yaml
|
|
27
|
-
name: my-app
|
|
28
|
-
mode: docker
|
|
29
|
-
image: ghcr.io/my-org/my-app
|
|
30
|
-
|
|
31
|
-
servers:
|
|
32
|
-
web:
|
|
33
|
-
hosts: [203.0.113.10]
|
|
34
|
-
port: 3000
|
|
35
|
-
domains: [app.example.com]
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### How It Works:
|
|
39
|
-
1. `epd` builds an image locally (using BuildKit / buildx) tagged with the current commit SHA.
|
|
40
|
-
2. **Registry or SSH Stream**:
|
|
41
|
-
- If `registry:` is specified, `epd` pushes the image to your registry (e.g. GitHub Packages or Docker Hub), and servers pull it.
|
|
42
|
-
- If no registry is specified, `epd` streams the image directly to each server over SSH using `docker save | gzip | ssh ... docker load`.
|
|
43
|
-
3. Containers run on a shared Docker bridge network (`epd`).
|
|
44
|
-
4. Replicas communicate with Traefik using internal container names:
|
|
45
|
-
`http://epd-<app>-<service>-<slot>-<replica>:<port>`
|
|
46
|
-
|
|
47
|
-
### Custom Docker Build Configuration
|
|
48
|
-
```yaml
|
|
49
|
-
build:
|
|
50
|
-
dockerfile: docker/Dockerfile.prod
|
|
51
|
-
context: .
|
|
52
|
-
platform: linux/amd64
|
|
53
|
-
args:
|
|
54
|
-
NODE_ENV: production
|
|
55
|
-
API_URL: https://api.example.com
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## 2. Process Mode (No Docker on Server)
|
|
61
|
-
|
|
62
|
-
If you don't want or can't run Docker on your servers (for example, on a tiny 512MB or 1GB VPS), `mode: process` runs your code natively using **PM2**.
|
|
63
|
-
|
|
64
|
-
```yaml
|
|
65
|
-
name: my-app
|
|
66
|
-
mode: process
|
|
67
|
-
|
|
68
|
-
process:
|
|
69
|
-
install: bun install --frozen-lockfile
|
|
70
|
-
build: bun run build
|
|
71
|
-
start: bun run start
|
|
72
|
-
exclude:
|
|
73
|
-
- ".git"
|
|
74
|
-
- "node_modules"
|
|
75
|
-
- ".env"
|
|
76
|
-
- "dist"
|
|
77
|
-
- "*.log"
|
|
78
|
-
|
|
79
|
-
servers:
|
|
80
|
-
web:
|
|
81
|
-
hosts: [203.0.113.10]
|
|
82
|
-
replicas: 2
|
|
83
|
-
port: 3000
|
|
84
|
-
domains: [app.example.com]
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### How It Works:
|
|
88
|
-
1. `epd` uploads your code via `rsync` into `/var/lib/epd/apps/<app>/releases/<version>/`.
|
|
89
|
-
2. Runs the `install` and `build` commands directly on the server.
|
|
90
|
-
3. Starts each replica under `pm2` with an assigned unique localhost port (e.g., `20101`, `20102`).
|
|
91
|
-
4. Traefik (running as a native binary managed by PM2) automatically routes traffic from ports 80/443 to the healthy PM2 replica ports.
|
|
92
|
-
|
|
93
|
-
### Runtime Examples
|
|
94
|
-
|
|
95
|
-
::: code-group
|
|
96
|
-
|
|
97
|
-
```yaml [Bun (TypeScript / JavaScript)]
|
|
98
|
-
mode: process
|
|
99
|
-
process:
|
|
100
|
-
install: bun install --frozen-lockfile
|
|
101
|
-
build: bun run build
|
|
102
|
-
start: bun run start
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
```yaml [Node.js (Next.js / Express / Fastify)]
|
|
106
|
-
mode: process
|
|
107
|
-
process:
|
|
108
|
-
install: npm ci --omit=dev
|
|
109
|
-
build: npm run build
|
|
110
|
-
start: npm run start
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
```yaml [Python (FastAPI / Django / Flask)]
|
|
114
|
-
mode: process
|
|
115
|
-
process:
|
|
116
|
-
install: pip install -r requirements.txt
|
|
117
|
-
start: python -m uvicorn main:app --host 127.0.0.1 --port $PORT
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
```yaml [Go (Precompiled Binary)]
|
|
121
|
-
mode: process
|
|
122
|
-
process:
|
|
123
|
-
build: go build -o server .
|
|
124
|
-
start: ./server
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
:::
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## Next Steps
|
|
132
|
-
|
|
133
|
-
- Understand the **[Blue/Green Lifecycle](/guide/blue-green)**
|
|
134
|
-
- Read about **[Multi-Site Hosting](/guide/multi-site)**
|
|
135
|
-
- Learn how to manage **[Secrets & Environment](/guide/secrets)**
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
# Getting Started with EPD
|
|
2
|
-
|
|
3
|
-
Deploy any application to one server or a fleet of servers with zero downtime, automatic Let's Encrypt SSL, and a shared Traefik proxy.
|
|
4
|
-
|
|
5
|
-
This guide will take you from zero to a live production deployment in under 5 minutes.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Prerequisites
|
|
10
|
-
|
|
11
|
-
Before starting, ensure you have:
|
|
12
|
-
|
|
13
|
-
1. **A Linux Server (VPS)**:
|
|
14
|
-
- Any clean Linux VPS (Ubuntu 22.04/24.04, Debian 11/12, Fedora, Arch, etc.)
|
|
15
|
-
- An open SSH port (22) with root or passwordless `sudo` access (or password to allow EPD to configure it).
|
|
16
|
-
- Public ports **80** (HTTP) and **443** (HTTPS) accessible from the internet.
|
|
17
|
-
- A DNS `A` record pointing your domain to the server's public IP address.
|
|
18
|
-
|
|
19
|
-
2. **Local Machine**:
|
|
20
|
-
- Linux or macOS (or Windows via WSL2).
|
|
21
|
-
- Standard `ssh` client.
|
|
22
|
-
- Docker installed locally (if deploying in Docker mode to build images).
|
|
23
|
-
|
|
24
|
-
::: tip No Server Yet?
|
|
25
|
-
If you don't have a server, you can provision one in 30 seconds using the built-in [Hetzner Cloud integration](/hetzner-dns):
|
|
26
|
-
```bash
|
|
27
|
-
epd hetzner create my-server --setup
|
|
28
|
-
```
|
|
29
|
-
:::
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## 1. Install EPD
|
|
34
|
-
|
|
35
|
-
Install `epd` using the zero-dependency standalone installer (requires no Node.js or Bun runtime), or via your favorite package manager:
|
|
36
|
-
|
|
37
|
-
::: code-group
|
|
38
|
-
|
|
39
|
-
```bash [curl (Zero Dependencies)]
|
|
40
|
-
curl -fsSL https://raw.githubusercontent.com/FabioPlunser/epd/main/install.sh | bash
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
```bash [bun]
|
|
44
|
-
bun install -g @fabioplunser/epd
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
```bash [npm]
|
|
48
|
-
npm install -g @fabioplunser/epd
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
```bash [pnpm]
|
|
52
|
-
pnpm add -g @fabioplunser/epd
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
```bash [npx (no install)]
|
|
56
|
-
npx @fabioplunser/epd --help
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
:::
|
|
60
|
-
|
|
61
|
-
Verify installation:
|
|
62
|
-
```bash
|
|
63
|
-
epd --version
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## 2. Shell Autocompletion (Optional)
|
|
69
|
-
|
|
70
|
-
Enable instant tab-completion for all commands, flags, and destination overlays:
|
|
71
|
-
|
|
72
|
-
::: code-group
|
|
73
|
-
|
|
74
|
-
```bash [zsh]
|
|
75
|
-
eval "$(epd completion zsh)"
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
```bash [bash]
|
|
79
|
-
source <(epd completion bash)
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
```bash [fish]
|
|
83
|
-
epd completion fish | source
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
:::
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## 3. Initialize Your Project
|
|
91
|
-
|
|
92
|
-
Navigate to your application's root directory:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
cd my-app
|
|
96
|
-
epd init
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
`epd init` will inspect your project:
|
|
100
|
-
- Automatically detects your runtime (Node.js, Bun, Python, Go, Ruby, or static).
|
|
101
|
-
- Detects whether you already have a `Dockerfile`.
|
|
102
|
-
- Prompts for your server IP, domain name, and ACME SSL email.
|
|
103
|
-
- Generates a tailored `epd.yml` config file (and an optimized starter `Dockerfile` if needed).
|
|
104
|
-
|
|
105
|
-
::: tip GitHub Actions Starter
|
|
106
|
-
Run `epd init --ci` or `epd gh-action` to also generate a ready-to-run GitHub Actions workflow (`.github/workflows/deploy.yml`).
|
|
107
|
-
:::
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## 4. Configure `epd.yml`
|
|
112
|
-
|
|
113
|
-
Open `epd.yml` in your editor. Here is a typical single-server configuration:
|
|
114
|
-
|
|
115
|
-
::: code-group
|
|
116
|
-
|
|
117
|
-
```yaml [Docker Mode (Default)]
|
|
118
|
-
# Application name (used for container naming and routing isolation)
|
|
119
|
-
name: my-app
|
|
120
|
-
mode: docker
|
|
121
|
-
|
|
122
|
-
# Docker image name (built locally, or pulled from registry)
|
|
123
|
-
image: my-app
|
|
124
|
-
|
|
125
|
-
# SSH connection details
|
|
126
|
-
ssh:
|
|
127
|
-
user: root
|
|
128
|
-
|
|
129
|
-
# Server & Routing
|
|
130
|
-
servers:
|
|
131
|
-
web:
|
|
132
|
-
hosts: [203.0.113.10]
|
|
133
|
-
port: 3000
|
|
134
|
-
domains: [app.example.com]
|
|
135
|
-
|
|
136
|
-
# Shared Traefik Proxy & Automatic SSL
|
|
137
|
-
proxy:
|
|
138
|
-
email: admin@example.com
|
|
139
|
-
|
|
140
|
-
# Health check probe before switching live traffic
|
|
141
|
-
healthcheck:
|
|
142
|
-
path: /health
|
|
143
|
-
timeout: 30
|
|
144
|
-
|
|
145
|
-
# Environment variables & secrets
|
|
146
|
-
env:
|
|
147
|
-
clear:
|
|
148
|
-
NODE_ENV: production
|
|
149
|
-
secret:
|
|
150
|
-
- DATABASE_URL
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
```yaml [Process Mode (No Docker on Server)]
|
|
154
|
-
# Run code directly under PM2 without Docker on the host
|
|
155
|
-
name: my-app
|
|
156
|
-
mode: process
|
|
157
|
-
|
|
158
|
-
process:
|
|
159
|
-
install: bun install --frozen-lockfile
|
|
160
|
-
build: bun run build
|
|
161
|
-
start: bun run start
|
|
162
|
-
exclude: [".git", "node_modules", ".env", "dist"]
|
|
163
|
-
|
|
164
|
-
ssh:
|
|
165
|
-
user: root
|
|
166
|
-
|
|
167
|
-
servers:
|
|
168
|
-
web:
|
|
169
|
-
hosts: [203.0.113.10]
|
|
170
|
-
replicas: 2
|
|
171
|
-
port: 3000
|
|
172
|
-
domains: [app.example.com]
|
|
173
|
-
|
|
174
|
-
proxy:
|
|
175
|
-
email: admin@example.com
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
:::
|
|
179
|
-
|
|
180
|
-
### Secrets Setup
|
|
181
|
-
|
|
182
|
-
Any secret declared under `env.secret` is resolved automatically from your local shell or `.env` file:
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
# In your local .env or current shell:
|
|
186
|
-
export DATABASE_URL="postgres://user:password@host/dbname"
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
When you deploy, `epd` securely uploads secrets into a root-owned `0600` file on the remote server without saving secrets in git or container image layers.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## 5. Pre-flight Checks (`epd doctor`)
|
|
194
|
-
|
|
195
|
-
Run `epd doctor` to verify your local tools, secrets, and server reachability before deploying:
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
epd doctor
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
`epd doctor` confirms:
|
|
202
|
-
- Local Bun/Node, Docker engine, and clean git state
|
|
203
|
-
- SSH client and key permissions (`0600`)
|
|
204
|
-
- `epd.yml` syntax and `.env` secret availability
|
|
205
|
-
- Remote server SSH reachability, passwordless sudo, Docker health, and free disk space
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
## 6. Run Server Setup
|
|
210
|
-
|
|
211
|
-
Run `epd setup` once for each new server:
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
epd setup
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### Automated SSH & Server Onboarding:
|
|
218
|
-
- **Password Prompt**: If your server only has password login enabled, `epd setup` prompts for the server password once.
|
|
219
|
-
- **Key Installation**: It installs your public key (`~/.ssh/id_ed25519.pub`) to `~/.ssh/authorized_keys`.
|
|
220
|
-
- **Passwordless Sudo**: Configures `/etc/sudoers.d/epd` automatically so future commands run non-interactively.
|
|
221
|
-
- **Docker & Traefik**: Installs Docker and starts Traefik reverse proxy with Let's Encrypt SSL.
|
|
222
|
-
- **Initial Deploy**: Builds your image, boots slot `blue`, verifies health checks, and registers routes.
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
## 7. Deploy Updates with Zero Downtime
|
|
227
|
-
|
|
228
|
-
Whenever you commit changes or want to deploy an update:
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
epd deploy
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
Want to preview the deployment plan without changing anything on the servers? Run a dry run:
|
|
235
|
-
```bash
|
|
236
|
-
epd deploy --dry-run
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
`epd deploy` executes a zero-downtime blue/green swap:
|
|
240
|
-
1. Builds the latest container image (or syncs process code).
|
|
241
|
-
2. Starts the new version in the **idle slot** (e.g., `green`).
|
|
242
|
-
3. Probes the internal health check endpoint until healthy.
|
|
243
|
-
4. Atomically updates Traefik's dynamic routing to direct incoming requests to the new slot.
|
|
244
|
-
5. Drains in-flight connections to the previous slot (`blue`) before gracefully stopping it.
|
|
245
|
-
|
|
246
|
-
::: tip Rollback Anytime
|
|
247
|
-
If an issue occurs after deployment, revert instantly to the previous version with:
|
|
248
|
-
```bash
|
|
249
|
-
epd rollback
|
|
250
|
-
```
|
|
251
|
-
This re-activates the previous slot in seconds without rebuilding or re-uploading!
|
|
252
|
-
:::
|
|
253
|
-
|
|
254
|
-
---
|
|
255
|
-
|
|
256
|
-
## 8. Inspect & Monitor
|
|
257
|
-
|
|
258
|
-
Use `epd` CLI commands to check your application's health and operations:
|
|
259
|
-
|
|
260
|
-
```bash
|
|
261
|
-
# Check running containers, active slots, and route status
|
|
262
|
-
epd status
|
|
263
|
-
|
|
264
|
-
# Stream live container logs
|
|
265
|
-
epd logs -f
|
|
266
|
-
|
|
267
|
-
# Real-time multi-server CPU, memory, and container monitor
|
|
268
|
-
epd top
|
|
269
|
-
|
|
270
|
-
# Inspect Let's Encrypt SSL/TLS certificates and days to expiry
|
|
271
|
-
epd ssl
|
|
272
|
-
|
|
273
|
-
# Toggle zero-downtime 503 maintenance page
|
|
274
|
-
epd maintenance on -m "Upgrading database. Back in 10 minutes."
|
|
275
|
-
epd maintenance off
|
|
276
|
-
|
|
277
|
-
# Create compressed database / volume backups
|
|
278
|
-
epd backup db
|
|
279
|
-
|
|
280
|
-
# Open an interactive shell inside a running replica
|
|
281
|
-
epd shell
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
---
|
|
285
|
-
|
|
286
|
-
## Next Steps
|
|
287
|
-
|
|
288
|
-
Now that your application is live, explore additional capabilities:
|
|
289
|
-
|
|
290
|
-
- **[Architecture & Concepts](/guide/architecture)**: How Traefik routing, blue/green slots, and failover work.
|
|
291
|
-
- **[Deployment Modes](/guide/deployment-modes)**: Compare Docker vs. Process (PM2) modes.
|
|
292
|
-
- **[Multi-Site Hosting](/guide/multi-site)**: Host 5, 10, or 20 distinct domains on a single VPS.
|
|
293
|
-
- **[Accessories & Databases](/guide/accessories)**: Spin up PostgreSQL, Redis, or MinIO alongside your app.
|
|
294
|
-
- **[GitHub Actions CI/CD](/ci-cd)**: Set up fully automated deployments on every `git push`.
|
|
295
|
-
- **[Hetzner Cloud & DNS](/hetzner-dns)**: Automate server provisioning and Cloudflare/Hetzner DNS sync.
|
|
296
|
-
- **[CLI Reference](/reference/cli)**: Complete list of all CLI commands and flags.
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# High Availability & Multi-Server Clustering
|
|
2
|
-
|
|
3
|
-
Scale your application across multiple servers with rolling zero-downtime updates, cross-host load balancing, and private network routing.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Multi-Server Architecture
|
|
8
|
-
|
|
9
|
-
When deploying to multiple hosts, `epd` can either route traffic locally on each server or establish a distributed ingress mesh across all nodes.
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
DNS (Round Robin or Cloudflare)
|
|
13
|
-
┌──────────────┴──────────────┐
|
|
14
|
-
│ │
|
|
15
|
-
▼ ▼
|
|
16
|
-
┌───────────────────┐ ┌───────────────────┐
|
|
17
|
-
│ Server 1 (Host A) │ │ Server 2 (Host B) │
|
|
18
|
-
│ Traefik Proxy │◄───────►│ Traefik Proxy │
|
|
19
|
-
│ Replicas (Slot G) │ Private │ Replicas (Slot G) │
|
|
20
|
-
└───────────────────┘ Network └───────────────────┘
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## 1. Cross-Host Routing (`proxy.cross_host: true`)
|
|
26
|
-
|
|
27
|
-
By default, Traefik on Server A balances requests only among containers running on Server A.
|
|
28
|
-
|
|
29
|
-
With `proxy.cross_host: true`:
|
|
30
|
-
- Each server's Traefik instance includes upstream replica targets across the **entire cluster**.
|
|
31
|
-
- If Server B experiences hardware failure or is undergoing maintenance, requests arriving at Server B's IP address can be transparently forwarded to healthy containers on Server A.
|
|
32
|
-
|
|
33
|
-
```yaml
|
|
34
|
-
name: my-app
|
|
35
|
-
mode: docker
|
|
36
|
-
image: ghcr.io/my-org/my-app
|
|
37
|
-
|
|
38
|
-
proxy:
|
|
39
|
-
cross_host: true
|
|
40
|
-
# Bind internal service traffic to private VPC network IPs
|
|
41
|
-
private_ips:
|
|
42
|
-
203.0.113.10: 10.0.0.10
|
|
43
|
-
203.0.113.11: 10.0.0.11
|
|
44
|
-
203.0.113.12: 10.0.0.12
|
|
45
|
-
|
|
46
|
-
servers:
|
|
47
|
-
web:
|
|
48
|
-
hosts:
|
|
49
|
-
- 203.0.113.10
|
|
50
|
-
- 203.0.113.11
|
|
51
|
-
- 203.0.113.12
|
|
52
|
-
replicas: 2
|
|
53
|
-
port: 3000
|
|
54
|
-
domains: [app.example.com]
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## 2. Deployment Strategies: Rolling vs. Parallel
|
|
60
|
-
|
|
61
|
-
When deploying updates to a multi-server cluster, `epd` controls the rollout strategy:
|
|
62
|
-
|
|
63
|
-
### Rolling Deployment (Default)
|
|
64
|
-
|
|
65
|
-
```yaml
|
|
66
|
-
strategy: rolling
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
In a rolling deployment:
|
|
70
|
-
1. `epd` deploys to Host 1 and waits until health probes pass.
|
|
71
|
-
2. Once Host 1 is live and serving new traffic, it moves to Host 2.
|
|
72
|
-
3. This sequence repeats until the entire fleet is updated.
|
|
73
|
-
4. If a failure occurs on Host 2, Host 1 is already healthy, and the deployment stops safely before breaking the remaining hosts.
|
|
74
|
-
|
|
75
|
-
### Parallel Deployment
|
|
76
|
-
|
|
77
|
-
```yaml
|
|
78
|
-
strategy: parallel
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Deploys to all configured hosts concurrently. Recommended for staging environments or non-critical worker clusters where deploy speed is prioritized.
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Next Steps
|
|
86
|
-
|
|
87
|
-
- Set up **[Automated Multi-Provider DNS Synchronization](/hetzner-dns)**
|
|
88
|
-
- Configure **[Advanced Routing Rules](/guide/routing)**
|
|
89
|
-
- Check out the **[Complete Configuration Schema](/reference/config)**
|