Commit 6d490280 authored by Nick Busey's avatar Nick Busey

Moving to separate docker-compose files and services

parent 16bc3660
Pipeline #38987840 passed with stage
in 41 seconds
......@@ -8,6 +8,8 @@ This software has not reached version 1.0 and should therefore be considered uns
If you like getting your hands dirty in early versions of software, this is for you. If you prefer to wait till things are stable and friendly, maybe hold off for a while.
Also, if you trash your server or wreck your data, that's on you. Test your backups. Trust nothing.
## [Documentation](https://nickbusey.gitlab.io/HomelabOS/)
## Summary
......
......@@ -17,6 +17,7 @@ enable_homeassistant: False
enable_inventario: False
enable_jackett: False
enable_kibitzr: False
enable_mashio: False
enable_matomo: False
enable_miniflux: False
enable_minio: False
......@@ -90,11 +91,13 @@ services:
- grafana
- homeassistant
- inventario
- mashio
- matomo
- miniflux
- minio
- monicahq
- nextcloud
- organizr
- paperless
- pihole
- portainer
......
[Unit]
Description=HomelabOS bulletnotes Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/bulletnotes/docker-compose.bulletnotes.yml -p bulletnotes down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/bulletnotes/docker-compose.bulletnotes.yml -p bulletnotes up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/bulletnotes/docker-compose.bulletnotes.yml -p bulletnotes stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
---
- name: Configure Dasher
template: src=dasher.config.json dest=/var/homelabos/dasher/config.json
- name: Make dasher directory.
file:
path: "/var/homelabos/dasher"
state: directory
- name: Copy dasher docker-compose.yml file into place.
template:
src: docker-compose.dasher.yml.j2
dest: /var/homelabos/dasher/docker-compose.dasher.yml
vars:
tor_domain: "{{ tor_http_domain_file.stdout }}"
- name: Configure dasher systemd service.
template: src=dasher.service dest=/etc/systemd/system/dasher.service
- name: Start dasher
systemd:
name: dasher
enabled: "yes"
daemon-reload: "yes"
state: started
...
[Unit]
Description=HomelabOS dasher Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/dasher/docker-compose.dasher.yml -p dasher down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/dasher/docker-compose.dasher.yml -p dasher up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/dasher/docker-compose.dasher.yml -p dasher stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
---
version: '3'
services:
# Amazon Dash Button
dasher:
image: hijinx/dasher
restart: unless-stopped
network_mode: host
volumes:
- /var/homelabos/dasher/config.json:/usr/src/app/config/config.json
\ No newline at end of file
......@@ -21,6 +21,8 @@ services:
- TZ={{ common_timezone }}
- ServerName=money.{{ domain }}
image: jc5x/firefly-iii
links:
- firefly_iii_db
networks:
- traefik_network
volumes:
......
---
- name: Make gitea directory.
file:
path: "/var/homelabos/gitea"
state: directory
- name: Copy gitea docker-compose.yml file into place.
template:
src: docker-compose.gitea.yml.j2
dest: /var/homelabos/gitea/docker-compose.gitea.yml
vars:
tor_domain: "{{ tor_http_domain_file.stdout }}"
- name: Configure gitea systemd service.
template: src=gitea.service dest=/etc/systemd/system/gitea.service
- name: Start gitea
systemd:
name: gitea
enabled: "yes"
daemon-reload: "yes"
state: started
...
---
version: '3'
networks:
traefik_network:
external:
name: homelabos_traefik
services:
# Code Hosting
gitea:
image: gitea/gitea:latest
networks:
- traefik_network
environment:
- USER_UID=1000
- USER_GID=1000
restart: unless-stopped
links:
- gitea_db:db
volumes:
- /var/lab/homelabos/gitea:/data
ports:
- "3030:3000"
- "222:22"
depends_on:
- gitea_db
labels:
- "traefik.enable=true"
- "traefik.docker.network=homelabos_traefik"
- "traefik.http.frontend.rule=Host:gitea.{{ domain }}"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM http://{{ domain }}"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM https://{{ domain }}"
- "traefik.http.protocol=http"
- "traefik.http.port=3000"
- "traefik.tor.frontend.rule=Host:gitea.{{ tor_domain }}"
- "traefik.tor.protocol=http"
- "traefik.tor.port=3000"
gitea_db:
image: mariadb
networks:
- traefik_network
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=gitea
- MYSQL_USER=gitea
- MYSQL_PASSWORD=gitea
- MYSQL_DATABASE=gitea
volumes:
- /var/homelabos/gitea_db:/var/lib/mysql
\ No newline at end of file
[Unit]
Description=HomelabOS gitea Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/gitea/docker-compose.gitea.yml -p gitea down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/gitea/docker-compose.gitea.yml -p gitea up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/gitea/docker-compose.gitea.yml -p gitea stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -52,6 +52,7 @@ enable_homeassistant: {{enable_homeassistant}}
enable_inventario: {{enable_inventario}}
enable_jackett: {{enable_jackett}}
enable_kibitzr: {{enable_kibitzr}}
enable_mashio: {{enable_mashio}}
enable_matomo: {{enable_matomo}}
enable_miniflux: {{enable_miniflux}}
enable_minio: {{enable_minio}}
......
......@@ -8,7 +8,7 @@ networks:
services:
# Home Inventory Management
inventario:
app:
image: nickbusey/inventario
restart: unless-stopped
networks:
......
---
- name: Make jackett directory.
file:
path: "/var/homelabos/jackett"
state: directory
- name: Copy jackett docker-compose.yml file into place.
template:
src: docker-compose.jackett.yml.j2
dest: /var/homelabos/jackett/docker-compose.jackett.yml
vars:
tor_domain: "{{ tor_http_domain_file.stdout }}"
- name: Configure jackett systemd service.
template: src=jackett.service dest=/etc/systemd/system/jackett.service
- name: Start jackett
systemd:
name: jackett
enabled: "yes"
daemon-reload: "yes"
state: started
...
---
version: '3'
networks:
traefik_network:
external:
name: homelabos_traefik
services:
# Torrent API
jackett:
image: linuxserver/jackett
restart: unless-stopped
volumes:
- /var/homelabos/jackett/config:/config
- /var/homelabos/jackett/downloads:/downloads
- /etc/localtime:/etc/localtime:ro
environment:
- TZ={{ common_timezone }}
ports:
- 9117:9117
\ No newline at end of file
[Unit]
Description=HomelabOS jackett Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/jackett/docker-compose.jackett.yml -p jackett down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/jackett/docker-compose.jackett.yml -p jackett up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/jackett/docker-compose.jackett.yml -p jackett stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
---
- name: Make kibitzr directory.
file:
path: "/var/homelabos/kibitzr"
state: directory
- name: Copy kibitzr docker-compose.yml file into place.
template:
src: docker-compose.kibitzr.yml.j2
dest: /var/homelabos/kibitzr/docker-compose.kibitzr.yml
vars:
tor_domain: "{{ tor_http_domain_file.stdout }}"
- name: Configure kibitzr systemd service.
template: src=kibitzr.service dest=/etc/systemd/system/kibitzr.service
- name: Start kibitzr
systemd:
name: kibitzr
enabled: "yes"
daemon-reload: "yes"
state: started
...
---
version: '3'
networks:
traefik_network:
external:
name: homelabos_traefik
services:
# IFTTT Replacement
kibitzr:
image: peterdemin/kibitzr
restart: unless-stopped
volumes:
- /var/homelabos/kibitzr/config:/root/.config/kibitzr
- /var/homelabos/kibitzr/pages:/pages
[Unit]
Description=HomelabOS kibitzr Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/kibitzr/docker-compose.kibitzr.yml -p kibitzr down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/kibitzr/docker-compose.kibitzr.yml -p kibitzr up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/kibitzr/docker-compose.kibitzr.yml -p kibitzr stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
---
- name: Make mashio directory.
file:
path: "/var/homelabos/mashio"
state: directory
- name: Copy mashio docker-compose.yml file into place.
template:
src: docker-compose.mashio.yml.j2
dest: /var/homelabos/mashio/docker-compose.mashio.yml
vars:
tor_domain: "{{ tor_http_domain_file.stdout }}"
- name: Configure mashio systemd service.
template: src=mashio.service dest=/etc/systemd/system/mashio.service
- name: Start mashio
systemd:
name: mashio
enabled: "yes"
daemon-reload: "yes"
state: started
...
---
version: '3'
networks:
traefik_network:
external:
name: homelabos_traefik
services:
# Home Brewery Management
app:
image: nickbusey/mashio
restart: unless-stopped
networks:
- traefik_network
links:
- mashio_db
environment:
- MYSQL_DATABASE=mashio
- MYSQL_TEST_DATABASE=mashio_test
- MYSQL_USER=mashio
- MYSQL_PASSWORD=mashio
labels:
- "traefik.enable=true"
- "traefik.docker.network=homelabos_traefik"
- "traefik.http.frontend.rule=Host:mashio.{{ domain }}"
- "traefik.http.protocol=http"
- "traefik.http.port=80"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM http://{{ domain }}"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM https://{{ domain }}"
- "traefik.tor.frontend.rule=Host:mashio.{{ tor_domain }}"
- "traefik.tor.protocol=http"
- "traefik.tor.port=80"
mashio_db:
image: mariadb
restart: unless-stopped
networks:
- traefik_network
volumes:
- /var/homelabos/mashio_db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=mashio
- MYSQL_DATABASE=mashio
- MYSQL_TEST_DATABASE=mashio_test
- MYSQL_USER=mashio
- MYSQL_PASSWORD=mashio
\ No newline at end of file
[Unit]
Description=HomelabOS mashio Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/mashio/docker-compose.mashio.yml -p mashio down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/mashio/docker-compose.mashio.yml -p mashio up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/mashio/docker-compose.mashio.yml -p mashio stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
---
- name: Make matomo directory.
file:
path: "/var/homelabos/matomo"
state: directory
- name: Copy matomo docker-compose.yml file into place.
template:
src: docker-compose.matomo.yml.j2
dest: /var/homelabos/matomo/docker-compose.matomo.yml
vars:
tor_domain: "{{ tor_http_domain_file.stdout }}"
- name: Configure matomo systemd service.
template: src=matomo.service dest=/etc/systemd/system/matomo.service
- name: Start matomo
systemd:
name: matomo
enabled: "yes"
daemon-reload: "yes"
state: started
...
---
version: '3'
networks:
traefik_network:
external:
name: homelabos_traefik
services:
# Web Analytics
app:
image: crazymax/matomo:latest
restart: unless-stopped
networks:
- traefik_network
links:
- matomo_db:db
volumes:
- /var/homelabos/matomo/data:/data
labels:
- "traefik.enable=true"
- "traefik.docker.network=homelabos_traefik"
- "traefik.http.frontend.rule=Host:matomo.{{ domain }}"
- "traefik.http.protocol=http"
- "traefik.http.port=80"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM http://{{ domain }}"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM https://{{ domain }}"
- "traefik.tor.frontend.rule=Host:matomo.{{ tor_domain }}"
- "traefik.tor.protocol=http"
- "traefik.tor.port=80"
matomo_db:
image: mariadb
restart: unless-stopped
networks:
- traefik_network
volumes:
- /var/homelabos/matomo/db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=matomo
- MYSQL_USER=matomo
- MYSQL_PASSWORD=matomo
- MYSQL_DATABASE=matomo
\ No newline at end of file
[Unit]
Description=HomelabOS matomo Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/matomo/docker-compose.matomo.yml -p matomo down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/matomo/docker-compose.matomo.yml -p matomo up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/matomo/docker-compose.matomo.yml -p matomo stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
---
- name: Make miniflux directory.
file:
path: "/var/homelabos/miniflux"
state: directory
- name: Copy miniflux docker-compose.yml file into place.
template:
src: docker-compose.miniflux.yml.j2
dest: /var/homelabos/miniflux/docker-compose.miniflux.yml
vars:
tor_domain: "{{ tor_http_domain_file.stdout }}"
- name: Configure miniflux systemd service.
template: src=miniflux.service dest=/etc/systemd/system/miniflux.service
- name: Start miniflux
systemd:
name: miniflux
enabled: "yes"
daemon-reload: "yes"
state: started
...
---
version: '3'
networks:
traefik_network:
external:
name: homelabos_traefik
services:
# RSS Reader
miniflux:
image: miniflux/miniflux:2.0.11
networks:
- traefik_network
restart: unless-stopped
links:
- miniflux_db:db
environment:
- DATABASE_URL=postgres://miniflux:EsQMeV35CskJPE9eJwwqeV3ZFfZZ@db/miniflux?sslmode=disable
labels:
- "traefik.enable=true"
- "traefik.docker.network=homelabos_traefik"
- "traefik.http.frontend.rule=Host:rss.{{ domain }}"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM http://{{ domain }}"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM https://{{ domain }}"
- "traefik.http.protocol=http"
- "traefik.http.port=8080"
- "traefik.tor.frontend.rule=Host:rss.{{ tor_domain }}"
- "traefik.tor.protocol=http"
- "traefik.tor.port=80"
miniflux_db:
image: postgres:10.1
restart: unless-stopped
environment:
- POSTGRES_USER=miniflux
- POSTGRES_PASSWORD=EsQMeV35CskJPE9eJwwqeV3ZFfZZ
volumes:
- /var/homelabos/miniflux/db:/var/lib/postgresql/data
\ No newline at end of file
[Unit]
Description=HomelabOS miniflux Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/miniflux/docker-compose.miniflux.yml -p miniflux down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/miniflux/docker-compose.miniflux.yml -p miniflux up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/miniflux/docker-compose.miniflux.yml -p miniflux stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
---
- name: Make minio directory.
file:
path: "/var/homelabos/minio"
state: directory
- name: Copy minio docker-compose.yml file into place.
template:
src: docker-compose.minio.yml.j2
dest: /var/homelabos/minio/docker-compose.minio.yml
vars:
tor_domain: "{{ tor_http_domain_file.stdout }}"
- name: Configure minio systemd service.
template: src=minio.service dest=/etc/systemd/system/minio.service
- name: Start minio
systemd:
name: minio
enabled: "yes"
daemon-reload: "yes"
state: started
...
---
version: '3'
networks:
traefik_network:
external:
name: homelabos_traefik
services:
# S3 Storage for Backups via Restic
minio:
image: minio/minio
networks:
- traefik_network
restart: unless-stopped
command: server /data
volumes:
- /mnt/nas/Backups/minio:/data
- /var/homelabos/minio/config:/root/.minio/
ports:
- 9110:9000
labels:
- "traefik.enable=true"
- "traefik.docker.network=homelabos_traefik"
- "traefik.http.frontend.rule=Host:minio.{{ domain }}"
- "traefik.http.protocol=http"
- "traefik.http.port=9000"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM http://{{ domain }}"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM https://{{ domain }}"
- "traefik.tor.frontend.rule=Host:minio.{{ tor_domain }}"
- "traefik.tor.protocol=http"
- "traefik.tor.port=9000"
\ No newline at end of file
[Unit]
Description=HomelabOS minio Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/minio/docker-compose.minio.yml -p minio down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/minio/docker-compose.minio.yml -p minio up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/minio/docker-compose.minio.yml -p minio stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
---
- name: Make monicahq directory.
file:
path: "/var/homelabos/monicahq"
state: directory
- name: Copy monicahq docker-compose.yml file into place.
template:
src: docker-compose.monicahq.yml.j2
dest: /var/homelabos/monicahq/docker-compose.monicahq.yml
vars:
tor_domain: "{{ tor_http_domain_file.stdout }}"
- name: Configure monicahq systemd service.
template: src=monicahq.service dest=/etc/systemd/system/monicahq.service
- name: Start monicahq