This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAcornfile
92 lines (82 loc) · 1.95 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
81
82
83
84
85
86
87
88
89
90
91
92
args: {
// Number of instances of the DNS service to run
scale: 1
// Name of the database
dbName: "acorn_dns"
// The AWS Route53 zone where FQDNs will be created
route53ZoneId: ""
// The tag that should be displayed in version information
tag: "v0.0.0-dev"
// The hostname of the database
dbHost: "db"
}
containers: {
"acorn-dns": {
if args.dbHost == "db" {
dependsOn: "db"
}
build: {
buildArgs: {
TAG: args.tag
}
context: "."
}
// Setup hot-reloading for api-server
if args.dev {
workdir: "/app"
image: "docker.io/cosmtrek/air" // https://github.com/cosmtrek/air
dirs: "/app": "./"
cmd: "api-server"
}
scale: args.scale
ports: "4315/http"
env: {
ACORN_DB_ENGINE: "mariadb"
ACORN_DB_USER: "secret://db-user-credentials/username?onchange=no-action"
ACORN_DB_PASSWORD: "secret://db-user-credentials/password?onchange=no-action"
ACORN_DB_HOST: args.dbHost
ACORN_DB_PORT: "3306"
ACORN_DB_NAME: args.dbName
ACORN_ROUTE53_ZONE_ID: args.route53ZoneId
AWS_ACCESS_KEY_ID: "secret://aws-creds/access-key?onchange=no-action"
AWS_SECRET_ACCESS_KEY: "secret://aws-creds/secret-key?onchange=no-action"
AWS_SESSION_TOKEN: "secret://aws-creds/session-token?onchange=no-action"
}
},
if args.dbHost == "db" {
db: {
image: "mariadb:10.7.4"
env: {
MARIADB_ROOT_PASSWORD: "secret://root-credentials/password?onchange=no-action"
MARIADB_USER: "secret://db-user-credentials/username?onchange=no-action"
MARIADB_PASSWORD: "secret://db-user-credentials/password?onchange=no-action"
MARIADB_DATABASE: args.dbName
}
ports: "3306/tcp"
}
}
}
secrets: {
if args.dbHost == "db" {
"root-credentials": {
type: "basic"
data: {
username: "root"
}
}
"db-user-credentials": {
type: "basic"
data: {
username: "acorn"
}
}
}
"aws-creds": {
type: "opaque"
data: {
"access-key": ""
"secret-key": ""
"session-token": ""
}
}
}