docker to services folder
This commit is contained in:
86
README.md
86
README.md
@@ -72,7 +72,7 @@ Check folder docker/promtail for more information
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Services (Stacks)
|
## Services
|
||||||
|
|
||||||
|
|
||||||
### External volumes
|
### External volumes
|
||||||
@@ -86,42 +86,88 @@ docker volume create --driver local --opt type=none --opt device=/ --opt o=bind
|
|||||||
### Portainer
|
### Portainer
|
||||||
for more information [check](https://git.limbosolutions.com/kb/portainer)
|
for more information [check](https://git.limbosolutions.com/kb/portainer)
|
||||||
|
|
||||||
|
#### Setup & Update
|
||||||
``` bash
|
``` bash
|
||||||
docker pull portainer/portainer-ce
|
services/portainer/docker-run.sh
|
||||||
docker stop portainer
|
|
||||||
docker rm portainer
|
|
||||||
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer:/data portainer/portainer-ce
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### nginx
|
### nginx
|
||||||
[docker-compose](docker/nginx/docker-compose.yaml)
|
|
||||||
|
|
||||||
|
#### Setup & Update
|
||||||
``` bash
|
``` bash
|
||||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt -subj "/C=PT/ST=Lisbon/L=Lisbon/O=LimboSolutions/OU=LimboSolutions/CN=has.lan"
|
services/nginx/docker-run.sh
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### code-server
|
### code-server
|
||||||
[docker-compose](docker/code-server/docker-compose.yaml)
|
|
||||||
|
|
||||||
|
#### Setup & Update
|
||||||
``` bash
|
``` bash
|
||||||
|
services/code-server/docker-run.sh
|
||||||
mkdir /config/workspace/docker/nginx/volumes
|
|
||||||
ln -s /mnt/nginx_config /config/workspace/docker/nginx/volumes/nginx_config
|
|
||||||
|
|
||||||
mkdir /config/workspace/docker/zigbee2mqtt/volume
|
|
||||||
ln -s /mnt/zigbee2mqtt_data /config/workspace/docker/zigbee2mqtt/volumes/zigbee2mqtt_datta
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### home assistant
|
### home assistant
|
||||||
[docker-compose](docker/has/docker-compose.yaml)
|
[Git Repo](https://git.limbosolutions.com/marcio.fernandes/homeAssistant)
|
||||||
|
|
||||||
|
[from dev machine](services/has/README.md)
|
||||||
|
|
||||||
|
|
||||||
|
for setup execute on portainer docker compose then mount on code server
|
||||||
|
```
|
||||||
|
- has_config:/config/workspace/host/repos/homesrv01.dev.lan/services/has/volumes/config
|
||||||
|
```
|
||||||
|
|
||||||
|
on code server from repo root folder
|
||||||
|
|
||||||
|
```
|
||||||
|
cd services
|
||||||
|
mkdir has
|
||||||
|
cd has
|
||||||
|
git glone ssh://git@git.limbosolutions.com:2222/marcio.fernandes/homeAssistant.git .
|
||||||
|
```
|
||||||
|
|
||||||
### LMS
|
### LMS
|
||||||
[docker-compose](docker/lms/docker-compose.yaml)
|
[Git Repo](https://git.limbosolutions.com/marcio.fernandes/lms)
|
||||||
|
|
||||||
|
[from dev machine](services/lms/README.md)
|
||||||
|
|
||||||
|
|
||||||
|
for setup execute on portainer docker compose then mount on code server
|
||||||
|
```
|
||||||
|
```
|
||||||
|
|
||||||
|
on code server from repo root folder
|
||||||
|
|
||||||
|
```
|
||||||
|
cd services
|
||||||
|
mkdir lms
|
||||||
|
cd lms
|
||||||
|
git glone https://git.limbosolutions.com/marcio.fernandes/lms .
|
||||||
|
```
|
||||||
|
|
||||||
|
### Mosquitto
|
||||||
|
|
||||||
|
[Git Repo](https://git.limbosolutions.com/marcio.fernandes/mosquitto)
|
||||||
|
|
||||||
|
[from dev machine](services/mosquitto/README.md)
|
||||||
|
|
||||||
|
|
||||||
|
for setup execute on portainer docker compose then mount on code server
|
||||||
|
```
|
||||||
|
- mosquitto_config:/config/workspace/host/repos/homesrv01.dev.lan/services/mosquitto/volumes/config
|
||||||
|
- mosquitto_data:/config/workspace/host/repos/homesrv01.dev.lan/service/mosquitto/volumes/data
|
||||||
|
```
|
||||||
|
|
||||||
|
on code server from repo root folder
|
||||||
|
|
||||||
|
```
|
||||||
|
cd services
|
||||||
|
mkdir mosquitto
|
||||||
|
cd mosquitto
|
||||||
|
git glone ssh://git@git.limbosolutions.com:2222/marcio.fernandes/mosquitto.git .
|
||||||
|
```
|
||||||
|
|
||||||
### mosquitto
|
|
||||||
[docker-compose](docker/mosquitto/docker-compose.yaml)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#scriptPath=$(dirname "$0") not working if called from symbolic link
|
|
||||||
scriptPath="$(dirname "$(readlink -f "$0")")"
|
scriptPath="$(dirname "$(readlink -f "$0")")"
|
||||||
doWork(){
|
doWork(){
|
||||||
apt update -y
|
apt update -y
|
||||||
apt upgrade -y
|
apt upgrade -y
|
||||||
$scriptPath/../docker/portainer/docker-run.sh
|
$scriptPath/../services/portainer/docker-run.sh
|
||||||
$scriptPath/../docker/promtail/docker-run.sh
|
$scriptPath/../services/promtail/docker-run.sh
|
||||||
$scriptPath/../docker/telegraf/docker-run.sh
|
$scriptPath/../services/telegraf/docker-run.sh
|
||||||
$scriptPath/../docker/code-server/docker-run.sh
|
$scriptPath/../services/code-server/docker-run.sh
|
||||||
$scriptPath/../docker/nginx/docker-run.sh
|
$scriptPath/../services/nginx/docker-run.sh
|
||||||
docker image prune -f
|
docker image prune -f
|
||||||
}
|
}
|
||||||
doWork 2>&1 | logger -s -t "auto-update"
|
doWork 2>&1 | logger -s -t "auto-update"
|
||||||
|
|
||||||
#doWork 2>&1 | logger -t "auto-update"
|
|
||||||
#example to check logs for autou-pdate
|
|
||||||
#journalctl --since yesterday -u cron.service | grep auto-update
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ services:
|
|||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
- code-server_config:/config
|
- code-server_config:/config
|
||||||
- code-server_root:/root
|
- code-server_root:/root
|
||||||
- has_config:/config/workspace/host/repos/homesrv01.dev.lan/lib/homeAssistant/volumes/config
|
- has_config:/config/workspace/host/repos/homesrv01.dev.lan/services/has/volumes/config
|
||||||
- ./../nginx/volumes/nginx_conf:/config/workspace/host/repos/homesrv01.dev.lan/services/nginx/volumes/nginx_conf
|
- ./../nginx/volumes/nginx_conf:/config/workspace/host/repos/homesrv01.dev.lan/services/nginx/volumes/nginx_conf
|
||||||
- mosquitto_config:/config/workspace/host/repos/homesrv01.dev.lan/lib/mosquitto/volumes/config
|
- mosquitto_config:/config/workspace/host/repos/homesrv01.dev.lan/services/mosquitto/volumes/config
|
||||||
- mosquitto_data:/config/workspace/host/repos/homesrv01.dev.lan/lib/mosquitto/volumes/data
|
- mosquitto_data:/config/workspace/host/repos/homesrv01.dev.lan/services/mosquitto/volumes/data
|
||||||
- zigbee2mqtt_data:/config/workspace/host/repos/homesrv01.dev.lan/services/zigbee2mqtt/volumes/data
|
- zigbee2mqtt_data:/config/workspace/host/repos/homesrv01.dev.lan/services/zigbee2mqtt/volumes/data
|
||||||
- hostfs:/mnt/hostfs
|
- hostfs:/mnt/hostfs
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
Reference in New Issue
Block a user