From 5928f7c245f5ef90c30501954dcca41391cc5dc4 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 20 Oct 2022 20:21:55 +0900 Subject: [PATCH] added nextcloud and onlyoffice --- docker-stack/Makefile | 17 +++++++++++ docker-stack/nextcloud.yml | 47 ++++++++++++++++++++++++++++++ docker-stack/onlyoffice.yml | 57 +++++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 docker-stack/nextcloud.yml create mode 100644 docker-stack/onlyoffice.yml diff --git a/docker-stack/Makefile b/docker-stack/Makefile index 521f7df..5f81996 100644 --- a/docker-stack/Makefile +++ b/docker-stack/Makefile @@ -102,6 +102,23 @@ stack-up-grafana: stack-down-grafana: docker stack rm grafana-stack + +stack-up-nextcloud: + [ -d /media/seagate-1000/nextcloud ] || mkdir /media/seagate-1000/nextcloud + docker stack deploy --compose-file nextcloud.yml nextcloud-stack + +stack-down-nextcloud: + docker stack rm nextcloud-stack + +stack-up-onlyoffice: + [ -d /media/seagate-1000/onlyoffice ] || mkdir /media/seagate-1000/onlyoffice + [ -d /media/seagate-1000/onlyoffice/data ] || mkdir /media/seagate-1000/onlyoffice/data + [ -d /media/seagate-1000/onlyoffice/logs ] || mkdir /media/seagate-1000/onlyoffice/logs + docker stack deploy --compose-file onlyoffice.yml onlyoffice-stack + +stack-down-onlyoffice: + docker stack rm onlyoffice-stack + stack-up-monitor: stack-up-prometheus-node-exporter stack-up-prometheus stack-up-grafana stack-down-monitor: stack-down-grafana stack-down-prometheus stack-down-prometheus-node-exporter diff --git a/docker-stack/nextcloud.yml b/docker-stack/nextcloud.yml new file mode 100644 index 0000000..1eee308 --- /dev/null +++ b/docker-stack/nextcloud.yml @@ -0,0 +1,47 @@ +version: '3.8' + +networks: + host-network: + name: host + external: true + prometheus-network: + external: true + traefik-network: + external: true + database-network: + external: true + +services: + nextcloud-service: + image: docker.io/nextcloud:24-apache + hostname: nextcloud-service-host + networks: + - traefik-network + volumes: + - type: bind + source: /media/seagate-1000/nextcloud + target: /var/www/html + deploy: + mode: replicated + replicas: 1 + placement: + max_replicas_per_node: 1 + constraints: + ##- node.role == manager + - node.hostname == rose + resources: + reservations: + memory: 1GB + limits: + memory: 2GB + restart_policy: + condition: on-failure + labels: + - traefik.enable=true + ##- traefik.docker.network=traefik-network + - traefik.http.routers.nextcloud-https.entrypoints=websec + - traefik.http.routers.nextcloud-https.rule=Host(`nc.miflux.com`) + - traefik.http.routers.nextcloud-https.tls=true + - traefik.http.services.nextcloud-service.loadbalancer.server.port=80 + - traefik.http.services.nextcloud-service.loadbalancer.sticky.cookie=true + - traefik.http.services.nextcloud-service.loadbalancer.sticky.cookie.name=nextcloud-sticker diff --git a/docker-stack/onlyoffice.yml b/docker-stack/onlyoffice.yml new file mode 100644 index 0000000..11ce58c --- /dev/null +++ b/docker-stack/onlyoffice.yml @@ -0,0 +1,57 @@ +version: '3.8' + +networks: + host-network: + name: host + external: true + prometheus-network: + external: true + traefik-network: + external: true + database-network: + external: true + +services: + onlyoffice-service: + image: docker.io/onlyoffice/documentserver:7.2 + hostname: onlyoffice-service-host + networks: + - traefik-network + volumes: + - type: bind + source: /media/seagate-1000/onlyoffice/data + target: /var/www/onlyoffice/Data + - type: bind + source: /media/seagate-1000/onlyoffice/logs + target: /var/log/onlyoffice + environment: + - JWT_ENABLED=true + - JWT_SECRET=bf420c41310528273eb307be6d78a432abc7b0276bb8590304e13de09db2dc44 + deploy: + mode: replicated + replicas: 1 + placement: + max_replicas_per_node: 1 + ##constraints: + ##- node.role == worker + ##- node.role == manager + resources: + reservations: + memory: 1GB + limits: + memory: 2GB + restart_policy: + condition: on-failure + labels: + - traefik.enable=true + ##- traefik.docker.network=traefik-network + - traefik.http.routers.onlyoffice-https.entrypoints=websec + - traefik.http.routers.onlyoffice-https.rule=Host(`oo.miflux.com`) + - traefik.http.routers.onlyoffice-https.tls=true + - traefik.http.services.onlyoffice-service.loadbalancer.server.port=80 + - traefik.http.services.onlyoffice-service.loadbalancer.sticky.cookie=true + - traefik.http.services.onlyoffice-service.loadbalancer.sticky.cookie.name=onlyoffice-sticker + ## wss:// access has an issue without followings: + - traefik.http.middlewares.onlyoffice-headers.headers.customrequestheaders.X-Forwarded-Proto=https + - traefik.http.middlewares.onlyoffice-headers.headers.accessControlAllowOriginList=* + - traefik.http.routers.onlyoffice-https.middlewares=onlyoffice-headers