server/NextCloud/docker-compose.yml

54 lines
1.5 KiB
YAML

version: '3.8'
services:
nextcloud:
image: nextcloud
container_name: nextcloud
links:
- db
volumes:
- ./nextcloud:/var/www/html
networks:
- services
- nextcloud
depends_on:
- db
environment:
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=
- MYSQL_DATABASE=nextcloud
- MYSQL_HOST=db
labels:
## Expose Nextcloud Through Trefik ##
- "traefik.enable=true" # <== Enable traefik to proxy this container
- "traefik.http.routers.nextcloud.rule=Host(`nextcloud.luke-else.co.uk`) || Host(`www.nextcloud.luke-else.co.uk`)"
- "traefik.http.routers.nextcloud.entrypoints=http"
- "traefik.http.routers.nextcloud.middlewares=redirect@file"
- "traefik.http.routers.nextcloud-secured.rule=Host(`nextcloud.luke-else.co.uk`) || Host(`www.nextcloud.luke-else.co.uk`)"
- "traefik.http.routers.nextcloud-secured.entrypoints=https"
- "traefik.http.routers.nextcloud-secured.tls.certresolver=mytlschallenge"
restart: unless-stopped
db:
image: mariadb
container_name: nextclouddb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- ./db:/var/lib/mysql
networks:
- nextcloud
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=
- MYSQL_DATABASE=nextcloud
restart: unless-stopped
networks:
services:
external: true
nextcloud:
name: nextcloud