[Unit]
Description=Nextcloud file sync and collaboration
StartLimitIntervalSec=60
StartLimitBurst=3
Requires=nextcloud-postgres.service nextcloud-redis.service
After=nextcloud-postgres.service nextcloud-redis.service
[Container]
Image=docker.io/library/nextcloud:31-apache
AutoUpdate=registry
ContainerName=nextcloud
Network=nextcloud.network
PublishPort=${SERVICE_PORT_HTTP}:80
Volume=%h/.local/share/services/nextcloud/app:/var/www/html:Z,U
Volume=%h/.local/share/services/nextcloud/data:/var/www/html/data:Z
Pull=missing
EnvironmentFile=%h/.local/share/services/nextcloud/.env
HealthCmd=curl -sf http://localhost/status.php || exit 1
HealthStartPeriod=120s
HealthInterval=30s
HealthRetries=5
[Service]
EnvironmentFile=%h/.local/share/services/nextcloud/.env
Restart=always
RestartSec=5
TimeoutStartSec=900
ExecStartPost=/bin/bash %h/.local/share/services/nextcloud/configs/scripts/configure-background-jobs.sh
ExecStartPost=/bin/bash %h/.local/share/services/nextcloud/configs/scripts/configure-smtp.sh
ExecStartPost=/bin/bash %h/.local/share/services/nextcloud/configs/scripts/configure-oidc.sh
[Install]
WantedBy=default.target