Initial commit

This commit is contained in:
Daan Vanoverloop 2022-02-14 17:11:23 +00:00
commit baba7a3379
15 changed files with 447 additions and 0 deletions

View File

@ -0,0 +1,36 @@
[Unit]
Description=Podman container-gitea-app.service
Wants=network-online.target
After=network-online.target
BindsTo=pod-gitea.service
After=pod-gitea.service
Requires=container-gitea-postgres.service
After=container-gitea-postgres.service
RequiresMountsFor=%t/containers
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm \
--pod-id-file %t/pod-gitea.pod-id \
--sdnotify=conmon --replace -d \
--name=gitea-app \
-v gitea:/data \
-v /home/git/.ssh/:/data/git/.ssh:z \
-v /etc/timezone:/etc/timezone:z,ro \
-v /etc/localtime:/etc/localtime:z,ro \
-e USER_UID=1001 -e USER_GID=1001 \
-e GITEA__database__DB_TYPE=postgres -e GITEA__database__HOST=localhost \
-e GITEA__database__NAME=gitea -e GITEA__database__USER=gitea -e GITEA__database__PASSWD=gitea \
--label "io.containers.autoupdate=registry" \
docker.io/gitea/gitea:latest
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

View File

@ -0,0 +1,28 @@
[Unit]
Description=Podman container-gitea-postgres.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
BindsTo=pod-gitea.service
After=pod-gitea.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm \
--pod-id-file %t/pod-gitea.pod-id \
--sdnotify=conmon --replace -d \
--name=gitea-postgres \
-v gitea-postgres:/var/lib/postgresql/data \
--label "io.containers.autoupdate=registry" \
docker.io/postgres:11
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

View File

@ -0,0 +1,38 @@
[Unit]
Description=Podman container-hass-app.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
BindsTo=pod-home-assistant.service
After=pod-home-assistant.service
Requires=container-hass-mosquitto.service
After=container-hass-mosquitto.service
Requires=container-hass-zigbee2mqtt.service
After=container-hass-zigbee2mqtt.service
Requires=container-hass-postgres.service
After=container-hass-postgres.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm --sdnotify=conmon --replace -d \
--name="hass-app" \
--pod-id-file %t/pod-home-assistant.pod-id \
-v hass-app:/config \
#-v /home/pi/containers/hass/homeassistant:/config:z \
-v /home/hass/.ssh:/root/.ssh:z \
-v /etc/localtime:/etc/localtime:z,ro \
--privileged \
-e TZ=Europe/Brussels \
--label "io.containers.autoupdate=registry" \
--net=host \
docker.io/homeassistant/raspberrypi4-64-homeassistant:stable
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

View File

@ -0,0 +1,28 @@
[Unit]
Description=Podman container-mosquitto.service
Wants=network-online.target
After=network-online.target
BindsTo=pod-home-assistant.service
After=pod-home-assistant.service
RequiresMountsFor=%t/containers
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm --sdnotify=conmon --replace -d \
--name=hass-mosquitto \
--pod-id-file %t/pod-home-assistant.pod-id \
-v hass-mosquitto-config:/mosquitto/config \
-v hass-mosquitto-data:/mosquitto/data \
--label "io.containers.autoupdate=registry" \
--net=host \
docker.io/eclipse-mosquitto
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

View File

@ -0,0 +1,31 @@
[Unit]
Description=Podman container-hass-postgres.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
BindsTo=pod-home-assistant.service
After=pod-home-assistant.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm \
--pod-id-file %t/pod-home-assistant.pod-id \
--sdnotify=conmon --replace -d \
--name=hass-postgres \
-e POSTGRES_USER=home-assistant \
-e POSTGRES_PASSWORD=home-assistant \
-e POSTGRES_DB=home-assistant \
--net=host \
-v hass-postgres:/var/lib/postgresql/data \
--label "io.containers.autoupdate=registry" \
docker.io/postgres:14
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

View File

@ -0,0 +1,31 @@
[Unit]
Description=Podman container-hass-zigbee2mqtt.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
Requires=container-hass-mosquitto.service
After=container-hass-mosquitto.service
BindsTo=pod-home-assistant.service
After=pod-home-assistant.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm --sdnotify=conmon --replace -d \
--name=hass-zigbee2mqtt \
--pod-id-file %t/pod-home-assistant.pod-id \
-v hass-zigbee2mqtt:/app/data \
-v /run/udev:/run/udev:ro -e TZ=Europe/Brussels \
--device=/dev/ttyACM0:/dev/ttyACM0 \
--label "io.containers.autoupdate=registry" \
--net=host \
docker.io/koenkk/zigbee2mqtt
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

View File

@ -0,0 +1,37 @@
[Unit]
Description=Podman container-nextcloud-fpm.service
Wants=network-online.target
After=network-online.target
Requires=container-nextcloud-redis.service
After=container-nextcloud-redis.service
Requires=container-nextcloud-postgres.service
After=container-nextcloud-postgres.service
RequiresMountsFor=%t/containers
BindsTo=pod-nextcloud.service
After=pod-nextcloud.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm --sdnotify=conmon --replace -d \
--name=nextcloud-fpm \
--pod-id-file %t/pod-nextcloud.pod-id \
-v nextcloud:/var/www/html:z \
-e POSTGRES_DB=nextcloud \
-e POSTGRES_USER=nextcloud \
-e POSTGRES_PASSWORD=nextcloud \
-e POSTGRES_HOST=localhost \
-e OVERWRITEPROTOCOL=https \
-e REDIS_HOST=localhost \
-e "NEXTCLOUD_TRUSTED_DOMAINS=cloud.vanoverloop.xyz cloud.vanoverloop.duckdns.org" \
--label "io.containers.autoupdate=registry" \
docker.io/nextcloud:fpm-alpine
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

View File

@ -0,0 +1,29 @@
[Unit]
Description=Podman container-nextcloud-nginx.service
Wants=network-online.target
After=network-online.target
Requires=container-nextcloud-fpm.service
After=container-nextcloud-fpm.service
RequiresMountsFor=%t/containers
BindsTo=pod-nextcloud.service
After=pod-nextcloud.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm --sdnotify=conmon --replace -d \
--name=nextcloud-nginx \
--pod-id-file %t/pod-nextcloud.pod-id \
-v nextcloud:/var/www/html \
-v /var/lib/containers/storage/volumes/nextcloud-nginx/_data/nginx.conf:/etc/nginx/nginx.conf \
--label "io.containers.autoupdate=registry" \
docker.io/nginx
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

View File

@ -0,0 +1,29 @@
[Unit]
Description=Podman container-postgres.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
BindsTo=pod-nextcloud.service
After=pod-nextcloud.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm --sdnotify=conmon --replace -d \
--name=nextcloud-postgres \
--pod-id-file %t/pod-nextcloud.pod-id \
-v nextcloud-postgres:/var/lib/postgresql/data \
-e POSTGRES_USER=nextcloud \
-e POSTGRES_PASSWORD=nextcloud \
-e POSTGRES_DB=nextcloud \
--label "io.containers.autoupdate=registry" \
docker.io/postgres:13
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

View File

@ -0,0 +1,25 @@
[Unit]
Description=Podman container-redis.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
BindsTo=pod-nextcloud.service
After=pod-nextcloud.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm --sdnotify=conmon --replace -d \
--pod-id-file %t/pod-nextcloud.pod-id \
--name=nextcloud-redis \
--label "io.containers.autoupdate=registry" \
docker.io/redis:alpine
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

40
container-pihole.service Normal file
View File

@ -0,0 +1,40 @@
[Unit]
Description=Podman container-pihole.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/mkdir -p /home/pi/containers/pihole
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm --sdnotify=conmon --replace -d \
--name=pihole \
--hostname=pi-hole \
--cap-add=NET_ADMIN \
--dns=127.0.0.1 \
--dns=1.1.1.1 \
-e TZ=Europe/Brussels \
-e SERVERIP=192.168.1.222 \
-e DNS1=1.1.1.1 \
-e DNS2=1.0.0.1 \
-e DNSMASQ_LISTENING=all \
-e WEBPASSWORD=cw+89hF>F&R)p0BFQ?W5 \
-e TEMPERATUREUNIT=c \
-v /home/pi/containers/pihole/etc-pihole:/etc/pihole:Z \
-v /home/pi/containers/pihole/etc-dnsmasq.d:/etc/dnsmasq.d:Z \
-p 8321:80/tcp \
-p 67:67/udp \
-p 53:53/tcp \
-p 53:53/udp \
--label "io.containers.autoupdate=registry" \
docker.io/pihole/pihole
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

27
container-proxy.service Normal file
View File

@ -0,0 +1,27 @@
[Unit]
Description=Podman container-proxy.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/mkdir -p /home/pi/containers/proxy
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run --cidfile=%t/%n.ctr-id --cgroups=no-conmon --rm --sdnotify=conmon --replace -d \
--name=proxy \
-v /home/pi/containers/proxy/data:/data:z \
-v /home/pi/containers/proxy/letsencrypt:/etc/letsencrypt:z \
--ip=10.88.0.17 \
-p 80:80 -p 443:443 -p 81:81 \
--label "io.containers.autoupdate=registry" \
docker.io/jc21/nginx-proxy-manager:latest
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target

22
pod-gitea.service Normal file
View File

@ -0,0 +1,22 @@
[Unit]
Description=Podman pod-gitea.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=
Requires=container-gitea-app.service container-gitea-postgres.service
Before=container-gitea-app.service container-gitea-postgres.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-gitea.pid %t/pod-gitea.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/pod-gitea.pid --pod-id-file %t/pod-gitea.pod-id -p 8444:3000 -p 2222:22 --name gitea --replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-gitea.pod-id
ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/pod-gitea.pod-id -t 10
ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/pod-gitea.pod-id
PIDFile=%t/pod-gitea.pid
Type=forking
[Install]
WantedBy=default.target

View File

@ -0,0 +1,24 @@
[Unit]
Description=Podman pod-home-assistant.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=
#Requires=container-hass-app.service container-hass-zigbee2mqtt.service container-hass-mosquitto.service
#Before=container-hass-app.service container-hass-zigbee2mqtt.service container-hass-mosquitto.service
Requires=container-hass-app.service container-hass-zigbee2mqtt.service container-hass-mosquitto.service container-hass-postgres.service
Before=container-hass-app.service container-hass-zigbee2mqtt.service container-hass-mosquitto.service container-hass-postgres.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-home-assistant.pid %t/pod-home-assistant.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/pod-home-assistant.pid --pod-id-file %t/pod-home-assistant.pod-id --network=host --name home-assistant --replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-home-assistant.pod-id
ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/pod-home-assistant.pod-id -t 10
ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/pod-home-assistant.pod-id
PIDFile=%t/pod-home-assistant.pid
Type=forking
[Install]
WantedBy=default.target

22
pod-nextcloud.service Normal file
View File

@ -0,0 +1,22 @@
[Unit]
Description=Podman pod-nextcloud.service
Wants=network-online.target
After=network-online.target
RequiresMountsFor=
Requires=container-nextcloud-fpm.service container-nextcloud-postgres.service container-nextcloud-redis.service container-nextcloud-nginx.service
Before=container-nextcloud-fpm.service container-nextcloud-postgres.service container-nextcloud-redis.service container-nextcloud-nginx.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-nextcloud.pid %t/pod-nextcloud.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/pod-nextcloud.pid --pod-id-file %t/pod-nextcloud.pod-id -p 8678:80 --name nextcloud --replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-nextcloud.pod-id
ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/pod-nextcloud.pod-id -t 10
ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/pod-nextcloud.pod-id
PIDFile=%t/pod-nextcloud.pid
Type=forking
[Install]
WantedBy=default.target