Add redis to nextcloud for file locking

This commit is contained in:
Wojciech Kozlowski 2023-08-17 20:23:08 +02:00
parent d09b2ae893
commit 00b0ccf4cb
8 changed files with 119 additions and 82 deletions

View File

@ -32,6 +32,7 @@
loop: loop:
- "pod-cloud.service" - "pod-cloud.service"
- "container-cloud-nginx.service" - "container-cloud-nginx.service"
- "container-cloud-redis.service"
- "container-cloud-chown.service" - "container-cloud-chown.service"
- "container-cloud-nextcloud.service" - "container-cloud-nextcloud.service"
- "container-cloud-cron.service" - "container-cloud-cron.service"

View File

@ -4,8 +4,8 @@ Documentation=man:podman-generate-systemd(1)
Wants=network.target Wants=network.target
After=network-online.target After=network-online.target
BindsTo=pod-cloud.service BindsTo=pod-cloud.service
Requires=container-cloud-chown.service Requires=container-cloud-chown.service container-cloud-redis.service
After=pod-cloud.service container-cloud-chown.service After=pod-cloud.service container-cloud-chown.service container-cloud-redis.service
OnFailure=status-mail@%n.service OnFailure=status-mail@%n.service
[Service] [Service]
@ -35,6 +35,7 @@ ExecStart=/usr/bin/podman run \
-e POSTGRES_DB_FILE=/run/secrets/database.name \ -e POSTGRES_DB_FILE=/run/secrets/database.name \
-e POSTGRES_USER_FILE=/run/secrets/database.user \ -e POSTGRES_USER_FILE=/run/secrets/database.user \
-e POSTGRES_PASSWORD_FILE=/run/secrets/database.password \ -e POSTGRES_PASSWORD_FILE=/run/secrets/database.password \
-e REDIS_HOST=localhost \
-e NEXTCLOUD_TRUSTED_DOMAINS="{{ services[services_service_name].domain }}" \ -e NEXTCLOUD_TRUSTED_DOMAINS="{{ services[services_service_name].domain }}" \
-e OVERWRITEPROTOCOL="https" \ -e OVERWRITEPROTOCOL="https" \
-e SMTP_HOST="{{ services[services_service_name].smtp.host }}" \ -e SMTP_HOST="{{ services[services_service_name].smtp.host }}" \

View File

@ -4,7 +4,7 @@ Documentation=man:podman-generate-systemd(1)
Wants=network.target Wants=network.target
After=network-online.target After=network-online.target
BindsTo=pod-cloud.service BindsTo=pod-cloud.service
After=pod-cloud.service After=pod-cloud.service pod-cloud-nextcloud.service
OnFailure=status-mail@%n.service OnFailure=status-mail@%n.service
[Service] [Service]

View File

@ -0,0 +1,34 @@
[Unit]
Description=Podman container-cloud-redis.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target
BindsTo=pod-cloud.service
After=pod-cloud.service
Before=pod-cloud-nextcloud.service
OnFailure=status-mail@%n.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/container-cloud-redis.pid %t/container-cloud-redis.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/container-cloud-redis.pid \
--cidfile %t/container-cloud-redis.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/pod-cloud.pod-id \
--replace \
--label "io.containers.autoupdate=image" \
--log-driver=journald \
-dt \
-v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \
--name=pod-cloud-redis \
docker.io/library/redis:{{ services_service_deploy_versions.redis }}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-cloud-redis.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-cloud-redis.ctr-id
PIDFile=%t/container-cloud-redis.pid
Type=forking
[Install]
WantedBy=multi-user.target default.target

View File

@ -3,8 +3,8 @@ Description=Podman pod-cloud.service
Documentation=man:podman-generate-systemd(1) Documentation=man:podman-generate-systemd(1)
Wants=network.target Wants=network.target
After=network-online.target After=network-online.target
Requires=container-cloud-nginx.service container-cloud-nextcloud.service container-cloud-cron.service Requires=container-cloud-nginx.service container-cloud-redis.service container-cloud-nextcloud.service container-cloud-cron.service
Before=container-cloud-nginx.service container-cloud-nextcloud.service container-cloud-cron.service Before=container-cloud-nginx.service container-cloud-redis.service container-cloud-nextcloud.service container-cloud-cron.service
OnFailure=status-mail@%n.service OnFailure=status-mail@%n.service
[Service] [Service]

View File

@ -12,6 +12,7 @@ services_deploy_versions:
cloud: cloud:
nginx: "stable" nginx: "stable"
nextcloud: "27-fpm" nextcloud: "27-fpm"
redis: "7"
git: git:
gitea: "1" gitea: "1"
notes: notes: