fest: zigbee2mqtt, nginx, code-server

This commit is contained in:
2024-05-25 10:23:34 +01:00
parent 91bfb4a9ac
commit 877ab22566
5 changed files with 80 additions and 11 deletions

2
.gitignore vendored
View File

@@ -3,3 +3,5 @@ docker/lms
docker/mosquitto
lib/*
lib2/*
docker/zigbee2mqtt/volumes/*
docker/nginx/volumes/*

View File

@@ -21,7 +21,7 @@ uname -r
```
## Development / Maintenance Environment
Currently docker code server as an editor.
Currently using docker code server as an editor.
But doing this way, **it is important to remember that editing files, git commands and control is done in VS CODE on the Development machine, but the execution of commands must be done over ssh.**
@@ -41,7 +41,7 @@ apt install sshfs
## fstab
```
#etc/fstab
#/etc/fstab
#sshfs#media@nas.lan:/home/media /mnt/media@sshfs:nas.lan fuse defaults,_netdev,allow_other,follow_symlinks 0 0
```
@@ -72,9 +72,17 @@ Check folder docker/promtail for more information
## Services (Stacks)
### External volumes
```
docker volume create --driver local --opt type=none --opt device=/home/admin/repos --opt o=bind hostfs_home_admin_repos
docker volume create --driver local --opt type=none --opt device=/mnt/media@sshfs:nas.lan --opt o=bind music
docker volume create --driver local --opt type=none --opt device=/ --opt o=bind hostfs
```
### Portainer
for more information [check](https://git.limbosolutions.com/kb/portainer)
@@ -85,9 +93,26 @@ 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
[docker-compose](docker/nginx/docker-compose.yaml)
```bash
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
```
### code-server
[docker-compose](docker/code-server/docker-compose.yaml)
```bash
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
[docker-compose](docker/has/docker-compose.yaml)
@@ -98,14 +123,6 @@ docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /va
[docker-compose](docker/mosquitto/docker-compose.yaml)
### duplicati
- Duplicati
[docker-compose](docker/duplicati/docker-compose.yaml)
### External volumes
```
docker volume create --driver local --opt type=none --opt device=/home/admin/repos --opt o=bind hostfs_home_admin_repos
docker volume create --driver local --opt type=none --opt device=/mnt/media@sshfs:nas.lan --opt o=bind music
docker volume create --driver local --opt type=none --opt device=/ --opt o=bind hostfs
```

View File

@@ -1,3 +1,4 @@
# stack name : code-server
version: '3'
services:
code-server:
@@ -10,11 +11,14 @@ services:
- PASSWORD=${CODESERVER_PASSWORD}
- DEFAULT_WORKSPACE=/config/workspace
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- code-server_config:/config
- code-server_root:/root
- has_config:/mnt/has_config
- nginx_conf:/mnt/nginx_config
- ssl_data:/mnt/ssl_data
- mosquitto_config:/mnt/mosquitto_config
- zigbee2mqtt_data:/mnt/zigbee2mqtt_data
- hostfs:/mnt/hostfs
networks:
- code
@@ -23,6 +27,9 @@ services:
- 8444:8443
restart: unless-stopped
volumes:
zigbee2mqtt_data:
name: zigbee2mqtt_data
external: true
code-server_config:
code-server_root:
has_config:
@@ -33,6 +40,9 @@ volumes:
nginx_conf:
name: reverseproxy_nginx-conf.d
external: true
ssl_data:
name: reverseproxy_etc_ssl
external: true
mosquitto_config:
external: true
networks:

View File

@@ -0,0 +1,21 @@
version: '3'
services:
nginx:
image: nginx
volumes:
- nginx-conf.d:/etc/nginx/conf.d
- etc_ssl:/etc/ssl
ports:
- 443:443
- 80:80
networks:
- public
- private
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
restart: unless-stopped
volumes:
nginx-conf.d:
etc_ssl:
networks:
public:
private:

View File

@@ -0,0 +1,19 @@
version: '3.8'
services:
zigbee2mqtt:
container_name: zigbee2mqtt
image: koenkk/zigbee2mqtt
restart: unless-stopped
volumes:
- data:/app/data
- /run/udev:/run/udev:ro
ports:
# Frontend port
- 8085:8080
environment:
- TZ=Europe/Berlin
devices:
# Make sure this matched your adapter location
- /dev/ttyUSB0:/dev/ttyUSB0
volumes:
data: