From 5852c5fbe138ba5f6a71bb99cefa7720b6e3ac15 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 8 Dec 2020 08:59:05 -0600 Subject: [PATCH] First commit of my docker env --- certbot-renew.sh | 12 ++++++ guacamole/docker-compose.yml | 67 +++++++++++++++++++++++++++++++ haproxy/docker-compose.yml | 69 ++++++++++++++++++++++++++++++++ heimdall/docker-compose.yml | 13 ++++++ homeassistant/docker-compose.yml | 16 ++++++++ nextcloud/docker-compose.yml | 41 +++++++++++++++++++ snipeit/docker-compose.yml | 43 ++++++++++++++++++++ stchart/docker-compose.yml | 36 +++++++++++++++++ thelounge/docker-compose.yml | 16 ++++++++ update-images.sh | 2 + xrdp/docker-compose.yml | 12 ++++++ 11 files changed, 327 insertions(+) create mode 100755 certbot-renew.sh create mode 100644 guacamole/docker-compose.yml create mode 100644 haproxy/docker-compose.yml create mode 100644 heimdall/docker-compose.yml create mode 100644 homeassistant/docker-compose.yml create mode 100644 nextcloud/docker-compose.yml create mode 100644 snipeit/docker-compose.yml create mode 100644 stchart/docker-compose.yml create mode 100644 thelounge/docker-compose.yml create mode 100644 update-images.sh create mode 100644 xrdp/docker-compose.yml diff --git a/certbot-renew.sh b/certbot-renew.sh new file mode 100755 index 0000000..2633321 --- /dev/null +++ b/certbot-renew.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# docker-compose -f /var/docker/config/haproxy/docker-compose.yml down +#/usr/bin/certbot certonly --force-renewal --standalone -d rs.hamik.net +#/usr/bin/certbot renew +/usr/local/bin/certbot certonly -d *.hamik.net --dns-route53 -m dan@paradizelost.net --agree-tos --non-interactive --server https://acme-v02.api.letsencrypt.org/directory --force-renewal +bash -c 'cat /etc/letsencrypt/live/hamik.net/fullchain.pem /etc/letsencrypt/live/hamik.net/privkey.pem > /var/docker/config/haproxy/data/ssl/hamik.net.pem' +export HOSTNAME=$HOSTNAME +docker kill -s HUP haproxy +#docker-compose -f /var/docker/config/haproxy/docker-compose.yml up -d +#docker-compose -f /var/docker/config/thelounge/docker-compose.yml up -d +#docker-compose -f /var/docker/config/guacamole/docker-compose.yml up -d + diff --git a/guacamole/docker-compose.yml b/guacamole/docker-compose.yml new file mode 100644 index 0000000..11e0bd1 --- /dev/null +++ b/guacamole/docker-compose.yml @@ -0,0 +1,67 @@ +version: '3' + +services: + guacd: + container_name: guacd + hostname: guacd + image: guacamole/guacd + restart: always + logging: + options: + max-size: "10m" + max-file: "3" + networks: + - xrdp_default + guacamole: + container_name: guacamole + hostname: guacamole + image: guacamole/guacamole + logging: + options: + max-size: "10m" + max-file: "3" + restart: always + networks: + - xrdp_default + volumes: + - ./data/config:/guacamole + #ports: + # - "8080:8080" + environment: + GUACD_HOSTNAME: ${GUACD_HOSTNAME} + GUACAMOLE_HOME: ${GUACAMOLE_HOME} + MYSQL_HOSTNAME: ${MYSQL_HOSTNAME} + MYSQL_PORT: ${MYSQL_PORT} + MYSQL_DATABASE: ${MYSQL_DATABASE} + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + LDAP_HOSTNAME: ${LDAP_HOSTNAME} + LDAP_PORT: ${LDAP_PORT} + LDAP_ENCRYPTION_METHOD: ${LDAP_ENCRYPTION_METHOD} + LDAP_USER_BASE_DN: ${LDAP_USER_BASE_DN} + LDAP_SEARCH_BIND_DN: ${LDAP_SEARCH_BIND_DN} + LDAP_SEARCH_BIND_PASSWORD: ${LDAP_SEARCH_BIND_PASSWORD} + LDAP_USERNAME_ATTRIBUTE: ${LDAP_USERNAME_ATTRIBUTE} + DUO_API_HOSTNAME: ${DUO_API_HOSTNAME} + DUO_INTEGRATION_KEY: ${DUO_INTEGRATION_KEY} + DUO_SECRET_KEY: ${DUO_SECRET_KEY} + DUO_APPLICATION_KEY: ${DUO_APPLICATION_KEY} + mariadb: + container_name: guacdb + hostname: guacdb + image: mariadb + restart: always + logging: + options: + max-size: "10m" + max-file: "3" + networks: + - xrdp_default + volumes: + - ./data/db:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + +networks: + xrdp_default: + external: true diff --git a/haproxy/docker-compose.yml b/haproxy/docker-compose.yml new file mode 100644 index 0000000..ac13ff4 --- /dev/null +++ b/haproxy/docker-compose.yml @@ -0,0 +1,69 @@ +version: '3' + +services: + haproxy: + container_name: haproxy + hostname: haproxy + # image: haproxy:latest + image: haproxy:latest + restart: always + logging: + options: + max-size: "10m" + max-file: "3" + volumes: + - ./data:/etc/haproxy + - ./data:/usr/local/etc/haproxy + ports: + - "443:443" + - "80:80" + - "8081:8080" + environment: + - DOCKER_HOST=${HOSTNAME} + networks: + - guacamole_default + - homeassistant_default + - kanboard_default + - mayanedms_default + - stchart_default + - thelounge_default + - gitlab_default + - xrdp_default + - pihole_default + - openxkpi_default + - grocy_default + - nextcloud_default + - snipeit_default + - teedy_default + - heimdall_default +networks: + nextcloud_default: + external: true + guacamole_default: + external: true + homeassistant_default: + external: true + kanboard_default: + external: true + mayanedms_default: + external: true + stchart_default: + external: true + thelounge_default: + external: true + gitlab_default: + external: true + xrdp_default: + external: true + pihole_default: + external: true + openxkpi_default: + external: true + grocy_default: + external: true + snipeit_default: + external: true + teedy_default: + external: true + heimdall_default: + external: true diff --git a/heimdall/docker-compose.yml b/heimdall/docker-compose.yml new file mode 100644 index 0000000..3ac8ec6 --- /dev/null +++ b/heimdall/docker-compose.yml @@ -0,0 +1,13 @@ +version: "2.1" +services: + heimdall: + image: ghcr.io/linuxserver/heimdall + container_name: heimdall + environment: + - PUID=1000 + - PGID=1000 + - TZ=America/Chicago + volumes: + - ./data/config:/config + restart: unless-stopped + diff --git a/homeassistant/docker-compose.yml b/homeassistant/docker-compose.yml new file mode 100644 index 0000000..95e4c4e --- /dev/null +++ b/homeassistant/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3' +services: + homeassistant: + container_name: home-assistant + image: homeassistant/home-assistant + logging: + options: + max-size: "10m" + max-file: "3" + volumes: + - ./data:/config + - /etc/localtime:/etc/localtime:ro + restart: always + ports: + - 8123:8123 + command: bash -c "sed -i -E \"s/_TLSv1/_TLS/g\" `find / -name roomba.py -print` && python3 -m homeassistant --config /config" diff --git a/nextcloud/docker-compose.yml b/nextcloud/docker-compose.yml new file mode 100644 index 0000000..3d1c217 --- /dev/null +++ b/nextcloud/docker-compose.yml @@ -0,0 +1,41 @@ +version: '2' + +volumes: + nextcloud: + db: + +services: + db: + container_name: nextclouddb + hostname: nextclouddb + image: mariadb + logging: + options: + max-file: "3" + max-size: "10m" + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + restart: always + volumes: + - ./data/db:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + MYSQL_DATABASE: ${MYSQL_DATABASE} + MYSQL_USER: ${MYSQL_USER} + + app: + image: nextcloud + container_name: nextcloud + hostname: nextcloud + logging: + options: + max-file: "3" + max-size: "10m" + ports: + - 8087:80 + links: + - db + volumes: + - ./data/nextcloud:/var/www/html + restart: always + diff --git a/snipeit/docker-compose.yml b/snipeit/docker-compose.yml new file mode 100644 index 0000000..a942fd0 --- /dev/null +++ b/snipeit/docker-compose.yml @@ -0,0 +1,43 @@ +version: '3' + +services: + snipeit: + container_name: snipeit + hostname: snipeit + image: snipe/snipe-it + restart: always + logging: + options: + max-file: "3" + max-size: "10m" + # ports: + # - 8089:80 + volumes: + - ./data/:/var/lib/snipeit + - /etc/letsencrypt/live/hamik.net/cert.pem:/var/lib/snipeit/ssl/snipeit-ssl.crt + - /etc/letsencrypt/live/hamik.net/privkey.pem:/var/lib/snipeit/ssl/snipeit-ssl.key + environment: + MYSQL_PORT_3306_TCP_ADDR: ${MYSQL_PORT_3306_TCP_ADDR} + MYSQL_PORT: ${MYSQL_PORT} + MYSQL_DATABASE: ${MYSQL_DATABASE} + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + APP_ENV: ${APP_ENV} + APP_DEBUG: ${APP_DEBUG} + APP_KEY: ${APP_KEY} + APP_URL: ${APP_URL} + APP_TIMEZONE: ${APP_TIMEZONE} + APP_LOCALE: ${APP_LOCALE} + snipeitdb: + container_name: snipeitdb + hostname: snipeitdb + image: mariadb + logging: + options: + max-file: "3" + max-size: "10m" + restart: always + volumes: + - ./data/db:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} diff --git a/stchart/docker-compose.yml b/stchart/docker-compose.yml new file mode 100644 index 0000000..02d8894 --- /dev/null +++ b/stchart/docker-compose.yml @@ -0,0 +1,36 @@ +version: '3' + +services: + influx: + container_name: influx + hostname: influx + image: influxdb + logging: + options: + max-size: "10m" + max-file: "3" + restart: always + volumes: + - ./influx:/var/lib/influxdb + ports: + - "8083:8083" + - "8086:8086" + - "2003:2003" + + grafana: + container_name: grafana + hostname: grafana + image: grafana/grafana + logging: + options: + max-size: "10m" + max-file: "3" + restart: always + volumes: + - ./grafana/var/lib/grafana:/var/lib/grafana + - ./grafana/etc/grafana/grafana.ini:/etc/grafana/grafana.ini + #ports: + # - "5000:3000" + environment: + # - INSTALL_PLUGINS="http://plugin-domain.com/my-custom-plugin.zip;custom-plugin" + - GF_SERVER_DOMAIN="ststats.hamik.net" diff --git a/thelounge/docker-compose.yml b/thelounge/docker-compose.yml new file mode 100644 index 0000000..e86b1b3 --- /dev/null +++ b/thelounge/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3' + +services: + lounge: + container_name: lounge + hostname: lounge + image: thelounge/thelounge + restart: always + logging: + options: + max-size: "10m" + max-file: "3" + volumes: + - ./data:/var/opt/thelounge + # ports: + #- "9000:9000" diff --git a/update-images.sh b/update-images.sh new file mode 100644 index 0000000..2c766e9 --- /dev/null +++ b/update-images.sh @@ -0,0 +1,2 @@ +find /var/docker/config -name docker-compose.yml -exec docker-compose -f {} pull \; +find /var/docker/config -name docker-compose.yml -exec docker-compose -f {} up -d --remove-orphans \; diff --git a/xrdp/docker-compose.yml b/xrdp/docker-compose.yml new file mode 100644 index 0000000..05e5e8e --- /dev/null +++ b/xrdp/docker-compose.yml @@ -0,0 +1,12 @@ +version: '2.1' +services: + terminalserver: + image: danielguerra/ubuntu-xrdp + container_name: xrdp + hostname: ltx + restart: always + shm_size: 1g + volumes: + - ./data/:/home/ + - ./passwd:/etc/passwd + - ./shadow:/etc/shadow