forked from acorn-io/acorn-starter-nextjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAcornfile
80 lines (69 loc) · 1.36 KB
/
Acornfile
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
args: {
// Turn on or off prisma studio being deployed
withStudio: false
}
services: db: {
image: "ghcr.io/acorn-io/mariadb:v1.0.0"
serviceArgs: {
dbName: "app"
username: "appuser"
}
}
containers: {
app: {
build: context: "."
dependsOn: "migrate"
dirs: "./prisma": "./prisma"
env: {
DB_URL: localData.dbUrl
}
ports: publish: "3000/http"
probes: readiness: {
http: {
url: "http://localhost:3000/api/todos"
}
}
// Setup hot-reloading if running in development mode
if args.dev {
build: {
target: "prisma"
}
dirs: {
"./prisma": "./prisma"
"./public": "./public"
"./src": "./src"
"./styles": "./styles"
"./package.json": "./package.json"
}
cmd: ["npm", "run", "dev"]
}
}
if args.dev && args.withStudio {
studio: {
image: "node:18-alpine"
dependsOn: "migrate"
dirs: "./prisma": "./prisma"
env: {
DB_URL: localData.dbUrl
}
ports: publish: "5555/http"
cmd: ["npx", "prisma", "studio"]
}
}
}
jobs: {
migrate: {
build: {
context: "."
target: "prisma"
}
cmd: ["sh", "prisma/migrate.sh"]
dependsOn: "db"
env: {
DB_URL: localData.dbUrl
}
}
}
localData: {
dbUrl: "mysql://@{services.db.secrets.user.username}:@{services.db.secrets.user.password}@@{services.db.address}:@{service.db.port.3306}/@{service.db.data.dbName}"
}