-
Notifications
You must be signed in to change notification settings - Fork 0
/
Acornfile
72 lines (66 loc) · 2.02 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
name: "Moodle Acorn"
description: "Acorn running Moodle"
readme: "./README.md"
icon: "./moodle.svg"
args: {
database_type: "mariadb"
mariadbname: "moodledb"
postgresdbname: "postgresdb"
moodle_username: "user"
moodle_password: "bitnami"
moodle_email: "[email protected]"
moodle_site_name: "New Site"
moodle_lang: "en"
}
localData: {
mariadb: {
services: mariadb: {
image: "ghcr.io/acorn-io/mariadb:v#.#.#-#"
serviceArgs: {
dbName: args.mariadbname
}
}
},
postgres: {
services: postgres:{
image: "ghcr.io/acorn-io/postgres:v#.#-#"
serviceArgs: {
dbName: args.postgresdbname
}
}
}
}
std.ifelse(args.database_type == "mariadb",localData.mariadb,localData.postgres)
containers: {
web: {
image: "docker.io/bitnami/moodle:4.3"
ports: {
publish: "80:8080/http"
}
env: {
MOODLE_DATABASE_TYPE: std.ifelse(args.database_type == "mariadb", "mariadb", "pgsql")
MOODLE_DATABASE_USER: std.ifelse(args.database_type == "mariadb", "@{service.mariadb.secrets.admin.username}","@{service.postgres.secrets.admin.username}" )
MOODLE_DATABASE_PASSWORD: std.ifelse(args.database_type == "mariadb", "@{service.mariadb.secrets.admin.password}", "@{service.postgres.secrets.admin.password}")
MOODLE_DATABASE_HOST: std.ifelse(args.database_type == "mariadb", "@{service.mariadb.address}", "@{service.postgres.address}")
MOODLE_DATABASE_PORT_NUMBER: std.ifelse(args.database_type == "mariadb", "@{service.mariadb.port.3306}", "@{service.postgres.port.5432}")
MOODLE_DATABASE_NAME: std.ifelse(args.database_type == "mariadb", "@{service.mariadb.data.dbName}", "@{service.postgres.data.dbName}")
MOODLE_USERNAME: args.moodle_username
MOODLE_PASSWORD: args.moodle_password
MOODLE_EMAIL: args.moodle_email
MOODLE_SITE_NAME: args.moodle_site_name
MOODLE_LANG: args.moodle_lang
}
dirs: {
"/bitnami/moodle": "volume://moodle"
"/bitnami/moodledata": "volume://moodledata"
}
}
}
volumes: {
moodle: {
size: "2G"
}
moodledata:{
size: "2G"
}
}