Skip to content

Commit a05483c

Browse files
committed
* Several updates 2023_09_24. See full commit log.
* Changed docker-compose-t2-media-db.yml to docker-compose-media-db.yml as this stack was not using Traefik. * Updated docker and docker compose versions in all stacks. * Docker extension fields were partially removed in my previous commit. Not its been removed from all my other stacks - due to readability issues. * Implemented Docker profiles to start and stop cntainers as a group - e.g. those that depend on mounts will be started using a bash script after the mounts become available. * No use for media-services.txt anymore after implementation of docker profiles. * Modified start-media-after-boot.sh to reflect the use of docker profiles. * Added addition PHP extensions to Docekrfile-php7 for my web stack. * Updated bash_aliases to use docker profiles. * Added prometheus and influxdb2 metrics for Traefik. * Exposes socket proxy port 2375 to local network - manage containers from home assistant * Some changes due to Plex now using media stored on Synology instead of Google Drive (Rclone) * Added node-exporter and glances to web stack for Grafana monitoring * Removed crowdsec-blocklists container. Could not find a use. * Testing mergerfs container on Synology * Updated traefik to 2.10
1 parent ac24d3e commit a05483c

17 files changed

+806
-443
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
!docker-compose-t2-synology.yml
1414
!docker-compose-t2-web.yml
1515
!docker-compose-npm.yml
16-
!docker-compose-t2-media-db.yml
16+
!docker-compose-media-db.yml
1717

1818
!.github
1919
.github/*
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
http:
2+
routers:
3+
hassos-rtr:
4+
rule: "Host(`hassos.{{env "DOMAINNAME_CLOUD_SERVER"}}`)"
5+
entryPoints:
6+
- https
7+
middlewares:
8+
- chain-no-auth
9+
service: hassos-svc
10+
tls:
11+
certResolver: dns-cloudflare
12+
services:
13+
hassos-svc:
14+
loadBalancer:
15+
servers:
16+
- url: "http://192.168.5.90:8123" # or whatever your external host's IP:port is

appdata/traefik2/rules/cloudserver/middlewares-chains.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ http:
33
chain-no-auth:
44
chain:
55
middlewares:
6-
- middlewares-traefik-bouncer # leave this out if you are not using CrowdSec
6+
#- middlewares-traefik-bouncer # leave this out if you are not using CrowdSec
77
- middlewares-rate-limit
88
- middlewares-https-redirectscheme
99
- middlewares-secure-headers
@@ -30,7 +30,16 @@ http:
3030
chain-oauth:
3131
chain:
3232
middlewares:
33-
- middlewares-traefik-bouncer # leave this out if you are not using CrowdSec
33+
#- middlewares-traefik-bouncer # leave this out if you are not using CrowdSec
34+
- middlewares-rate-limit
35+
- middlewares-https-redirectscheme
36+
- middlewares-secure-headers
37+
- middlewares-oauth
38+
- middlewares-compress
39+
40+
chain-oauth-no-crowdsec:
41+
chain:
42+
middlewares:
3443
- middlewares-rate-limit
3544
- middlewares-https-redirectscheme
3645
- middlewares-secure-headers

archives/autoindex.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Autoindex - Simple Directory Index
2+
autoindex:
3+
<<: *common-keys-apps # See EXTENSION FIELDS at the top
4+
container_name: autoindex
5+
image: dceoy/nginx-autoindex:latest
6+
# ports:
7+
# - "$AUTOINDEX_PORT:80"
8+
volumes:
9+
- /volume1:/var/lib/nginx/html:ro # Location you want to index
10+
labels:
11+
- "traefik.enable=true"
12+
## HTTP Routers
13+
- "traefik.http.routers.autoindex-rtr.entrypoints=https"
14+
- "traefik.http.routers.autoindex-rtr.rule=Host(`indexh.$DOMAINNAME0`)"
15+
## Middlewares
16+
- "traefik.http.routers.autoindex-rtr.middlewares=chain-oauth@file"
17+
## HTTP Services
18+
- "traefik.http.routers.autoindex-rtr.service=autoindex-svc"
19+
- "traefik.http.services.autoindex-svc.loadbalancer.server.port=80"

archives/crowdsec-blocklist.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# CrowdSec Blocklist Mirror - For PiHole/AdGuard Use
2+
# sudo docker exec crowdsec cscli bouncer add cloudflare-bouncer
3+
crowdsec-blocklist:
4+
image: crowdsecurity/blocklist-mirror
5+
container_name: crowdsec-blocklist
6+
security_opt:
7+
- no-new-privileges:true
8+
restart: unless-stopped
9+
profiles: ["apps", "all"]
10+
networks:
11+
- t2_proxy
12+
volumes:
13+
- $DOCKERDIR/appdata/crowdsec-blocklist/cfg.yaml:/etc/crowdsec/bouncers/crowdsec-blocklist-mirror.yaml
14+
labels:
15+
- "traefik.enable=true"
16+
## HTTP Routers
17+
- "traefik.http.routers.crowdsec-blocklist-rtr.entrypoints=https"
18+
- "traefik.http.routers.crowdsec-blocklist-rtr.rule=Host(`blocklist.$DOMAINNAME_SHB`)" # https://domain.com/security/blocklist
19+
## Middlewares
20+
- "traefik.http.routers.crowdsec-blocklist-rtr.middlewares=chain-oauth@file"
21+
## HTTP Services
22+
- "traefik.http.routers.crowdsec-blocklist-rtr.service=crowdsec-blocklist-svc"
23+
- "traefik.http.services.crowdsec-blocklist-svc.loadbalancer.server.port=41412"

archives/firefox.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Firefox - Web Broswer
2+
# VNC password not working - check
3+
firefox:
4+
<<: *common-keys-apps # See EXTENSION FIELDS at the top
5+
image: jlesage/firefox:latest
6+
container_name: firefox
7+
security_opt:
8+
- no-new-privileges:true
9+
- seccomp:unconfined # October 15, 2020 https://github.com/jlesage/docker-firefox/blob/master/README.md#allowing-the-membarrier-system-call
10+
# ports:
11+
# - "$FIREFOX_PORT:5800"
12+
volumes:
13+
- $DOCKERDIR/appdata/firefox:/config
14+
- $DOWNLOADSDIR:/config/Downloads
15+
- /dev/shm:/dev/shm
16+
environment:
17+
USER_ID: $PUID
18+
GROUP_ID: $PGID
19+
TZ: $TZ
20+
UMASK: 002
21+
KEEP_APP_RUNNING: 1
22+
CLEAN_TMP_DIR: 1
23+
DISPLAY_WIDTH: 1600
24+
DISPLAY_HEIGHT: 960
25+
# VNC_PASSWD: $FIREFOX_VNC_PASSWD # Since OAuth is enabled
26+
labels:
27+
- "traefik.enable=true"
28+
## HTTP Routers
29+
- "traefik.http.routers.firefox-rtr.entrypoints=https"
30+
- "traefik.http.routers.firefox-rtr.rule=Host(`firefoxh.$DOMAINNAME0`)"
31+
## Middlewares
32+
- "traefik.http.routers.firefox-rtr.middlewares=chain-oauth@file"
33+
## HTTP Services
34+
- "traefik.http.routers.firefox-rtr.service=firefox-svc"
35+
- "traefik.http.services.firefox-svc.loadbalancer.server.port=5800"

archives/mosquitto.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Mosquitto - MQTT Broker
2+
# Create mosquitto.conf, passwd, mosquitto.log files and set permissions to 775 user:docker
3+
# dexec mosquitto /bin/sh -> mosquitto_passwd -b /mosquitto/config/passwd username passwd
4+
mosquitto:
5+
<<: *common-keys-apps # See EXTENSION FIELDS at the top
6+
image: eclipse-mosquitto:latest
7+
container_name: mosquitto
8+
ports:
9+
- "$MOSQUITTO_HTTP_PORT:1883" #http
10+
- "9001:9001" #websockets
11+
# - "$MOSQUITTO_HTTPS_PORT:8883" #https
12+
volumes:
13+
- $DOCKERDIR/appdata/mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf
14+
- $DOCKERDIR/appdata/mosquitto/config/passwd:/mosquitto/config/passwd
15+
- $DOCKERDIR/shared:/shared
16+
environment:
17+
PUID: $PUID
18+
PGID: $PGID
19+
TZ: $TZ

custom/Dockerfile-php7

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/do
88

99

1010
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync && \
11-
install-php-extensions gd mysqli pdo_mysql opcache imagick exif zip mcrypt pspell redis sockets ssh2 bcmath intl
11+
install-php-extensions gd mysqli pdo_mysql opcache imagick exif zip mcrypt pspell redis sockets ssh2 bcmath intl calendar
1212

1313
# ADDED AUGUST 18, 2022 BECAUSE ERRORS IN PHP7 DOCKER LOGS TO INCREASE MAX_CHILDREN
1414
# https://serverfault.com/questions/884256/how-and-where-to-configure-pm-max-children-for-php-fpm-with-docker

docker-compose-t2-media-db.yml renamed to docker-compose-media-db.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ services:
5454
- default
5555
security_opt:
5656
- no-new-privileges:true
57-
restart: unless-stopped
57+
restart: "no"
58+
profiles: ["media", "all"]
5859
volumes:
5960
- $DOCKERDIR/appdata/airsonic/podcasts:/data/podcasts
6061
- $DOCKERDIR/appdata/airsonic/playlists:/data/playlists
6162
- $DOCKERDIR/appdata/airsonic/config:/config
62-
- $EXTDIR/ssd/home-server/local/music:/data/music
63+
- $DATADIR/media/music:/data/music
6364
ports:
6465
- "4040:4040"
6566
environment:
@@ -76,7 +77,8 @@ services:
7677
- default
7778
security_opt:
7879
- no-new-privileges:true
79-
restart: unless-stopped
80+
restart: "no"
81+
profiles: ["media", "all"]
8082
user: $PUID:$PGID
8183
devices:
8284
- /dev/dri:/dev/dri # for harware transcoding
@@ -100,7 +102,8 @@ services:
100102
- default
101103
security_opt:
102104
- no-new-privileges:true
103-
restart: unless-stopped
105+
restart: "no"
106+
profiles: ["media", "all"]
104107
devices:
105108
- /dev/dri:/dev/dri # for harware transcoding
106109
ports:
@@ -117,7 +120,7 @@ services:
117120
volumes:
118121
- $DOCKERDIR/appdata/plex:/config
119122
- $DATADIR/media:/data/media
120-
# - $DATADIR/nas_media:/data/nas_media
123+
# - $DATADIR/media:/data/media
121124
- $EXTDIR/ssd/home-server/downloads:/data/downloads
122125
- /dev/shm:/data/transcode # Offload transcoding to RAM if you have enough RAM
123126
environment:
@@ -143,6 +146,7 @@ services:
143146
security_opt:
144147
- no-new-privileges:true
145148
restart: unless-stopped
149+
profiles: ["dbs", "all"]
146150
ports:
147151
- "3306:3306"
148152
volumes:
@@ -164,6 +168,7 @@ services:
164168
security_opt:
165169
- no-new-privileges:true
166170
restart: unless-stopped
171+
profiles: ["dbs", "all"]
167172
ports:
168173
- "9090:9090"
169174
volumes:
@@ -187,12 +192,15 @@ services:
187192
security_opt:
188193
- no-new-privileges:true
189194
restart: unless-stopped
195+
profiles: ["dbs", "all"]
190196
ports:
191197
- "8086:8086"
192198
volumes:
193199
- $DOCKERDIR/appdata/influxdb2/config:/etc/influxdb2
194200
- $DOCKERDIR/appdata/influxdb2/db:/var/lib/influxdb2
195201

202+
############################# DATABASE
203+
196204
# Node Exporter - Metrics to Prometheus
197205
node-exporter:
198206
container_name: node-exporter

0 commit comments

Comments
 (0)