version: '3'
networks:
traefik:
external: true
nextcloud:
services:
redis:
image: redis:5
- nextcloud
expose:
- 6379
volumes:
- type: bind
source: /mnt/data/nextcloud/redis
target: /data
deploy:
placement:
constraints:
- "node.labels.nextcloud == true"
db:
image: mariadb:10.6
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
source: /mnt/data/nextcloud/db
target: /var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
app:
image: nextcloud
- traefik
links:
- db
source: /mnt/data/nextcloud/html
target: /var/www/html
- MYSQL_HOST=db
- REDIS_HOST=redis
- REDIS_HOST_PASSWORD=
labels:
- traefik.enable=true
- traefik.http.routers.nextcloud.entrypoints=websecure
- traefik.http.routers.nextcloud.rule=Host(`cloud.pim.kunis.nl`)
- traefik.http.routers.nextcloud.service=nextcloud
- traefik.http.routers.nextcloud.tls=true
- traefik.http.routers.nextcloud.tls.certresolver=letsencrypt
- traefik.docker.network=traefik
- traefik.http.services.nextcloud.loadbalancer.server.port=80