-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
94 lines (84 loc) · 1.97 KB
/
install.sh
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
93
94
#!/bin/bash
# Atualiza o sistema
sudo apt-get update
sudo apt-get upgrade -y
# Instala o Docker
sudo apt-get install -y docker.io
# Instala o Docker Compose
sudo apt-get install -y docker-compose
# Cria a pasta "docker" na raiz do sistema
sudo mkdir /docker
# Navega para a pasta "docker"
cd /docker
# Cria o arquivo docker-compose.yml
sudo touch docker-compose.yml
# Copia o conteúdo do docker-compose.yml para o arquivo recém-criado
sudo cat <<EOT >> docker-compose.yml
version: '3'
services:
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: always
ports:
- 3000:3000
# volumes:
# - grafana_data:/var/lib/grafana
sql:
image: mysql:latest
container_name: sql
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
ports:
- 3306:3306
volumes:
- sql_data:/var/lib/mysql
nextcloud:
image: nextcloud:latest
container_name: nextcloud
restart: always
ports:
- 8080:80
volumes:
- nextcloud_data:/var/www/html
zabbix:
image: zabbix/zabbix-server-mysql:latest
container_name: zabbix
restart: always
environment:
DB_SERVER_HOST: sql
MYSQL_DATABASE: zabbix
MYSQL_USER: zabbix
MYSQL_PASSWORD: zabbix
ports:
- 10051:10051
volumes:
- zabbix_data:/var/lib/zabbix
glpi:
image: linuxserver/glpi:latest
container_name: glpi
restart: always
environment:
DB_HOST: sql
DB_NAME: glpi
DB_USER: glpi
DB_PASSWORD: glpi
ports:
- 80:80
volumes:
- glpi_data:/var/www/html
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
restart: always
ports:
- 9000:9000
volumes:
- portainer_data:/data
- /var/run/docker.sock:/var/run/docker.sock
EOT
# Inicia o Docker Compose
sudo docker-compose up -d
#Exibe a mensagem de conclusão
echo "A configuração do Docker Compose e do Portainer foi concluída com sucesso!"