Initial commit.
This commit is contained in:
commit
7f3692740c
17
create.sh
Executable file
17
create.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#Absolute path to this script
|
||||||
|
SCRIPT=$(readlink -f $0)
|
||||||
|
#Absolute path this script is in
|
||||||
|
SCRIPTPATH=$(dirname $SCRIPT)
|
||||||
|
|
||||||
|
cd $SCRIPTPATH
|
||||||
|
|
||||||
|
for NETWORK in mysqlnet reverse-proxy
|
||||||
|
do
|
||||||
|
sudo docker network inspect ${NETWORK} &> /dev/null && continue
|
||||||
|
sudo docker network create ${NETWORK}
|
||||||
|
sudo docker network inspect ${NETWORK} &> /dev/null || \
|
||||||
|
{ echo "ERROR: could not create network ${NETWORK}, exiting."; exit 1; }
|
||||||
|
done
|
||||||
|
|
||||||
|
sudo -E bash -c 'docker-compose up --no-start'
|
24
docker-compose.yml
Normal file
24
docker-compose.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
version: "2.1"
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
grafana:
|
||||||
|
container_name: grafana
|
||||||
|
image: grafana/grafana
|
||||||
|
networks:
|
||||||
|
- reverse-proxy
|
||||||
|
- mysqlnet
|
||||||
|
expose:
|
||||||
|
- "3000/tcp"
|
||||||
|
volumes:
|
||||||
|
- /mnt/volumes/var_lib_grafana/data:/var/lib/grafana:Z
|
||||||
|
- /mnt/volumes/etc_grafana/data:/etc/grafana:Z
|
||||||
|
- /mnt/volumes/var_log_grafana/data:/var/log/grafana:Z
|
||||||
|
|
||||||
|
networks:
|
||||||
|
|
||||||
|
reverse-proxy:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
mysqlnet:
|
||||||
|
external: true
|
32
install.sh
Executable file
32
install.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#Absolute path to this script
|
||||||
|
SCRIPT=$(readlink -f $0)
|
||||||
|
#Absolute path this script is in
|
||||||
|
SCRIPTPATH=$(dirname $SCRIPT)
|
||||||
|
STACK=$(basename "$SCRIPTPATH")
|
||||||
|
|
||||||
|
mkdir -p /mnt/volumes/var_lib_grafana/data
|
||||||
|
chown -R 472:472 /mnt/volumes/var_lib_grafana/data
|
||||||
|
mkdir -p /mnt/volumes/etc_grafana/data
|
||||||
|
chown -R root:root /mnt/volumes/etc_grafana/data
|
||||||
|
chmod -R a+r /mnt/volumes/etc_grafana/data
|
||||||
|
mkdir -p /mnt/volumes/var_log_grafana/data
|
||||||
|
chown -R 472:472 /mnt/volumes/var_log_grafana/data
|
||||||
|
|
||||||
|
cat << EOF > /etc/systemd/system/${STACK}.service
|
||||||
|
[Unit]
|
||||||
|
Description=Starting ${STACK}
|
||||||
|
After=network-online.target firewalld.service docker.service docker.socket
|
||||||
|
Wants=network-online.target docker.service
|
||||||
|
Requires=docker.socket
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
User=$SUDO_USER
|
||||||
|
ExecStart=$SCRIPTPATH/start.sh
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable ${STACK}.service
|
Loading…
Reference in New Issue
Block a user