Split up to stacks and add portainer.

This commit is contained in:
2021-11-05 07:36:49 +01:00
parent 758ef900ff
commit 9dea2f7766
10 changed files with 350 additions and 193 deletions

View File

@@ -0,0 +1,59 @@
version: "3.9"
volumes:
nextcloud:
name: nextcloud
nextcloud-data:
name: nextcloud-data
nextcloud-config:
name: nextcloud-config
networks:
proxy:
external: true
internal:
external: true
services:
nextcloud:
image: nextcloud:22-fpm-alpine
container_name: nextcloud
restart: unless-stopped
volumes:
- nextcloud:/var/www/html
- nextcloud-data:/var/www/html/data
- nextcloud-config:/var/www/html/config
networks:
- internal
environment:
- MYSQL_DATABASE:nextcloud
- MYSQL_USER:nextcloud
- MYSQL_PASSWORD:jX9hKI2POvt1VrjVbBs4
- MYSQL_HOST:mysql8
- REDIS_HOST:redis
- REDIS_HOST_PASSWORD:${REDIS_PW}
- NEXTCLOUD_ADMIN_USER:${NEXTCLOUD_ADMIN_USER}
- NEXTCLOUD_ADMIN_PASSWORD:${NEXTCLOUD_ADMIN_PW}
- NEXTCLOUD_TRUSTED_DOMAINS:cs-nextcloud.ddnss.de nextcloud.localhost
- VIRTUAL_HOST:nextcloud
depends_on:
- psql14
- redis
nginx-nc:
image: nginx:alpine
container_name: nginx-nc
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.nextcloud.entrypoints=web"
- "traefik.http.routers.nextcloud.rule=Host(`nextcloud.localhost`)"
- "traefik.http.services.nextcloud.loadbalancer.server.port=80"
depends_on:
- nextcloud
networks:
- proxy
- internal
volumes:
- nextcloud:/var/www/html
- ${PWD}/nextcloud.conf:/etc/nginx/conf.d/default.conf