forked from plexguide/AppsFork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netdata.app
67 lines (57 loc) · 1.9 KB
/
netdata.app
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
#!/bin/bash
# ================================ DEFAULT VALUES ================================ #
default_variables() {
port_number=19999
time_zone=America/New_York
appdata_path=/pg/appdata/netdata
version_tag=latest
expose=
subdomain=netdata # Subdomain to use for Traefik routing
domain=9705.life # Base domain for Traefik routing
}
# ================================ CONTAINER DEPLOYMENT ================================ #
deploy_container() {
create_docker_compose() {
cat << EOF > /pg/ymals/${app_name}/docker-compose.yml
services:
${app_name}:
image: netdata/netdata:${version_tag}
container_name: ${app_name}
environment:
- PUID=1000
- PGID=1000
- TZ=${time_zone}
volumes:
- ${appdata_path}/netdataconfig:/etc/netdata
- ${appdata_path}/netdatalib:/var/lib/netdata
- ${appdata_path}/netdatacache:/var/cache/netdata
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/os-release:/host/etc/os-release:ro
ports:
- ${expose}${port_number}:19999
cap_add:
- SYS_PTRACE
security_opt:
- apparmor=unconfined
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.${app_name}.rule=Host(\`${subdomain}.${domain}\`)"
- "traefik.http.routers.${app_name}.entrypoints=websecure"
- "traefik.http.routers.${app_name}.tls.certresolver=mytlschallenge"
- "traefik.http.services.${app_name}.loadbalancer.server.port=19999"
networks:
- plexguide
networks:
plexguide:
external: true
EOF
}
}
# ================================ MENU GENERATION ================================ #
# NOTE: Generates Menus for the App. Requires 4 #'s' - See Wiki for Details
# ================================ EXTRA FUNCTIONS ================================ #
# NOTE: Extra Functions for Script Organization