-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.eph
More file actions
91 lines (77 loc) · 3.06 KB
/
Copy pathexample.eph
File metadata and controls
91 lines (77 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Example .eph file for a typical web application
# =============================================================================
# Roles: dependency services vs the first-party app
# =============================================================================
# `roles_order` splits the stack into tiers and orders them. Here the backing
# services (`dep`) come up before the app (`app`). The linear form below is
# shorthand for "app depends on dep"; a `[roles_order]` section can spell out a
# full dependency graph instead (e.g. a worker that needs `dep` but not `app`).
#
# Once roles exist you can bring up one tier on its own: `eph up --role dep`
# starts the dependency services (and anything they depend on) without touching
# the app. A Claude Code SessionStart hook can use that to prewarm the databases
# and caches so they are known-good and their connection env is ready the moment
# a session opens, leaving the app for you to start with `eph up` or `eph dev`
# when you actually want it. A later `eph dev` reuses the already-running
# dependency services and, on exit, tears down only the app it started, leaving
# the prewarmed tier hot.
roles_order=dep,app
# =============================================================================
# Services
# =============================================================================
[postgres]
image=postgres:16-alpine
role=dep
port=5432
env.POSTGRES_USER=dev
env.POSTGRES_PASSWORD=dev
env.POSTGRES_DB=myapp
volume=pgdata:/var/lib/postgresql/data
healthcheck=pg_isready -U dev
post-start=cargo sqlx migrate run
[redis]
image=redis:7-alpine
role=dep
port=6379
healthcheck=redis-cli ping
[minio]
image=minio/minio
role=dep
port.api=9000
port.console=9001
env.MINIO_ROOT_USER=minioadmin
env.MINIO_ROOT_PASSWORD=minioadmin
command=server /data --console-address ":9001"
volume=miniodata:/data
[mailhog]
image=mailhog/mailhog
role=dep
port.smtp=1025
port.web=8025
# The app you are building. eph allocates a free host port (so two checkouts
# never collide on 3000), injects it as PORT, and re-launches on a fresh port if
# the process dies on a port conflict. The `dep` tier above starts first, so
# DATABASE_URL etc. are already set in this process's environment.
[web]
run=npm run dev
role=app
port=auto
env.PORT=${web.port}
# pre-start runs before the dev server boots: regenerate the typed API client
# the app imports at startup. post-stop runs after the server stops: clean up a
# scratch upload dir eph never created and cannot remove on its own.
pre-start=npm run codegen
post-stop=rm -rf .cache/uploads
# =============================================================================
# Environment Variables
# =============================================================================
DATABASE_URL=postgres://dev:dev@localhost:${postgres.port}/myapp
REDIS_URL=redis://localhost:${redis.port}
S3_ENDPOINT=http://localhost:${minio.port.api}
S3_ACCESS_KEY=minioadmin
S3_SECRET_KEY=minioadmin
SMTP_HOST=localhost
SMTP_PORT=${mailhog.port.smtp}
MAIL_WEB_UI=http://localhost:${mailhog.port.web}
APP_URL=http://localhost:${web.port}
APP_ENV=development