-
Notifications
You must be signed in to change notification settings - Fork 240
/
redwood.go
34 lines (29 loc) · 972 Bytes
/
redwood.go
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
package scanner
func configureRedwood(sourceDir string, config *ScannerConfig) (*SourceInfo, error) {
if !checksPass(sourceDir, fileExists("redwood.toml")) {
return nil, nil
}
s := &SourceInfo{
Family: "RedwoodJS",
Files: templates("templates/redwood"),
Port: 8910,
ReleaseCmd: ".fly/release.sh",
}
s.Env = map[string]string{
"PORT": "8910",
// Telemetry gravely incrases memory usage, and isn't required
"REDWOOD_DISABLE_TELEMETRY": "1",
}
if checksPass(sourceDir+"/api/db", dirContains("*.prisma", "sqlite")) {
s.Env["MIGRATE_ON_BOOT"] = "true"
s.Env["DATABASE_URL"] = "file://data/sqlite.db"
s.Volumes = []Volume{
{
Source: "data",
Destination: "/data",
},
}
s.Notice = "\nThis deployment will run an SQLite on a single dedicated volume. The app can't scale beyond a single instance. Look into 'fly postgres' for a more robust production database that supports scaling up. \n"
}
return s, nil
}