Here’s my current docker compose file with everything working as it should (Nextcloud 34 latest):
services:
db:
container_name: nextcloud-db
image: $MARIADB_IMAGE
restart: unless-stopped
volumes:
- ./db:/var/lib/mysql:Z
- ./nextcloud-backup:/db_backups:rw
networks:
nextcloud-net:
ipv4_address: ${DB_IP}
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
env_file:
- db.env
redis:
container_name: nextcloud-redis
image: redis:alpine
restart: unless-stopped
networks:
nextcloud-net:
ipv4_address: ${REDIS_IP}
app:
container_name: nextcloud
image: $NEXTCLOUD_IMAGE
hostname: nextcloud
restart: unless-stopped
ports:
- ${NEXTCLOUD_PORT}:80
volumes:
- ./app:/var/www/html:z
- ./logs:/var/log/nextcloud
- /always-on/nextcloud/data:/data
- /always-on/www/web-root/files:/www:ro
networks:
nextcloud-net:
ipv4_address: ${APP_IP}
environment:
- MYSQL_HOST=db
- REDIS_HOST=redis
- PHP_MEMORY_LIMIT=1G
env_file:
- app.env
- db.env
depends_on:
- db
- redis
labels:
- "diun.enable=true"
- "deunhealth.restart.on.unhealthy=true"
signalling:
container_name: nextcloud-signalling
image: $SIGNALLING_IMAGE
restart: unless-stopped
ports:
- ${SIGNALLING_PORT}:8081
networks:
nextcloud-net:
ipv4_address: ${SIGNALLING_IP}
env_file:
- signalling.env
depends_on:
- app
labels:
- "diun.enable=true"
- "deunhealth.restart.on.unhealthy=true"
cron:
container_name: nextcloud-cron
image: $NEXTCLOUD_IMAGE
restart: unless-stopped
volumes:
- ./app:/var/www/html:z
- ./logs-cron:/var/log/nextcloud
- /always-on/nextcloud/data:/data
networks:
nextcloud-net:
ipv4_address: ${CRON_IP}
environment:
- MYSQL_HOST=db
- REDIS_HOST=redis
entrypoint: /cron.sh
env_file:
- app.env
- db.env
depends_on:
- app
networks:
nextcloud-net:
driver_opts:
com.docker.network.bridge.name: br-docker-nc
ipam:
config:
- subnet: ${IP_SUBNET}
gateway: ${GATEWAY_IP}
I’ve installed the “Client Push” app in Nextcloud. I have added the following lines to the appropriate reverse proxy config (Apache):
ProxyPass /push/ws ws://127.0.0.1:7867/ws
ProxyPass /push/ http://127.0.0.1:7867/
ProxyPassReverse /push/ http://127.0.0.1:7867/
I’ve added the following to my docker-compose.yaml:
notify_push:
container_name: nextcloud-notify
image: ghcr.io/nextcloud/notify_push:latest
restart: unless-stopped
ports:
- 7867:7867
env_file:
- app.env
- db.env
depends_on:
- db
- redis
- app
networks:
nextcloud-net:
ipv4_address: ${NOTIFY_PUSH_IP}
volumes:
- ./app:/var/www/html:z
- /always-on/nextcloud/data:/data:ro
labels:
- "diun.enable=true"
If I try to start the new nextcloud-notify container, I get this error repeatedly:
Error: × No nextcloud server is configured
It seems as if it cannot read my Nextcloud config file, even though I’ve mounted /var/www/html in the same way as the app and cron containers. If I try add command: "ls -la /var/www/html" to debug this, I just get told “ls” is an unknown command when trying to start the container. So I have nowhere to go. How do I work out why the container won’t start?
I cannot find an “official” example of how to do this with a docker setup in the docs either, so I’ve had to piece together what is needed from various sources! One source suggested not even using the official container and just running the binary using the normal Nextcloud container like so:
notify_push:
container_name: nextcloud-notify
image: $NEXTCLOUD_IMAGE
restart: unless-stopped
ports:
- 7867:7867
networks:
nextcloud-net:
ipv4_address: ${NOTIFY_PUSH_IP}
volumes:
- ./app:/var/www/html:z
- /always-on/nextcloud/data:/data
entrypoint: /var/www/html/custom_apps/notify_push/bin/x86_64/notify_push /var/www/html/config/config.php
env_file:
- app.env
- db.env
depends_on:
- db
- app
- redis
If I do it this way, the container comes up and if I enable debug mode using docker exec -it nextcloud-notify php occ notify_push:log debug I can see debug messages when editing files…but I don’t think anything is actually happening because if I try a test like so:
docker exec -it nextcloud-notify php occ notify_push:self-test
It immediately fails with 🗴 no push server configured!