forked from coop-cloud/nextcloud
		
	split db definitions in override files
This commit is contained in:
		@ -5,6 +5,10 @@ DOMAIN=nextcloud.example.com
 | 
				
			|||||||
#EXTRA_DOMAINS=', `www.nextcloud.example.com`'
 | 
					#EXTRA_DOMAINS=', `www.nextcloud.example.com`'
 | 
				
			||||||
LETS_ENCRYPT_ENV=production
 | 
					LETS_ENCRYPT_ENV=production
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COMPOSE_FILE="compose.yml"
 | 
				
			||||||
 | 
					COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"
 | 
				
			||||||
 | 
					#COMPOSE_FILE="$COMPOSE_FILE:compose.postgres.yml"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ADMIN_USER=admin
 | 
					ADMIN_USER=admin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SECRET_DB_ROOT_PASSWORD_VERSION=v1
 | 
					SECRET_DB_ROOT_PASSWORD_VERSION=v1
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										35
									
								
								compose.mariadb.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								compose.mariadb.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,35 @@
 | 
				
			|||||||
 | 
					version: "3.8"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					services:
 | 
				
			||||||
 | 
					  app:
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      - MYSQL_HOST=db
 | 
				
			||||||
 | 
					      - MYSQL_DATABASE=nextcloud
 | 
				
			||||||
 | 
					      - MYSQL_USER=nextcloud
 | 
				
			||||||
 | 
					      - MYSQL_PASSWORD_FILE=/run/secrets/db_password
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  db:
 | 
				
			||||||
 | 
					    image: "mariadb:10.5"
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      - MYSQL_DATABASE=nextcloud
 | 
				
			||||||
 | 
					      - MYSQL_USER=nextcloud
 | 
				
			||||||
 | 
					      - MYSQL_PASSWORD_FILE=/run/secrets/db_password
 | 
				
			||||||
 | 
					      - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
 | 
				
			||||||
 | 
					    configs:
 | 
				
			||||||
 | 
					      - source: my_tune
 | 
				
			||||||
 | 
					        target: /etc/mysql/conf.d/my-tune.cnf
 | 
				
			||||||
 | 
					    secrets:
 | 
				
			||||||
 | 
					      - db_root_password
 | 
				
			||||||
 | 
					      - db_password
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - "mariadb:/var/lib/mysql"
 | 
				
			||||||
 | 
					    networks:
 | 
				
			||||||
 | 
					      - internal
 | 
				
			||||||
 | 
					    deploy:
 | 
				
			||||||
 | 
					      labels:
 | 
				
			||||||
 | 
					          backupbot.backup: "true"
 | 
				
			||||||
 | 
					          backupbot.backup.pre-hook: 'mkdir -p /tmp/backup/ && mysqldump --single-transaction -u root -p"$$(cat /run/secrets/db_root_password)" nextcloud > /tmp/backup/backup.sql'
 | 
				
			||||||
 | 
					          backupbot.backup.post-hook: "rm -rf /tmp/backup"
 | 
				
			||||||
 | 
					          backupbot.backup.path: "/tmp/backup/"
 | 
				
			||||||
 | 
					volumes:
 | 
				
			||||||
 | 
					  mariadb:
 | 
				
			||||||
							
								
								
									
										32
									
								
								compose.postgres.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								compose.postgres.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,32 @@
 | 
				
			|||||||
 | 
					version: '3.8'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					services:
 | 
				
			||||||
 | 
					  app:
 | 
				
			||||||
 | 
					    entrypoint: "sh -c 'sleep 10 && /entrypoint.sh php-fpm'" # tries to mitigate this error with postgres https://github.com/nextcloud/docker/issues/1204
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      - POSTGRES_HOST=db
 | 
				
			||||||
 | 
					      - POSTGRES_DB=nextcloud
 | 
				
			||||||
 | 
					      - POSTGRES_USER=nextcloud
 | 
				
			||||||
 | 
					      - POSTGRES_PASSWORD_FILE=/run/secrets/db_password
 | 
				
			||||||
 | 
					      - NEXTCLOUD_UPDATE=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  db:
 | 
				
			||||||
 | 
					    image: "postgres:12"
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - "postgres:/var/lib/postgresql/data"
 | 
				
			||||||
 | 
					    networks:
 | 
				
			||||||
 | 
					      - internal
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      POSTGRES_USER: nextcloud 
 | 
				
			||||||
 | 
					      POSTGRES_PASSWORD_FILE: /run/secrets/db_password
 | 
				
			||||||
 | 
					      POSTGRES_DB: nextcloud 
 | 
				
			||||||
 | 
					    secrets:
 | 
				
			||||||
 | 
					      - db_password
 | 
				
			||||||
 | 
					    healthcheck:
 | 
				
			||||||
 | 
					      test: ["CMD-SHELL", "pg_isready"]
 | 
				
			||||||
 | 
					      interval: 10s
 | 
				
			||||||
 | 
					      timeout: 5s
 | 
				
			||||||
 | 
					      retries: 5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					volumes:
 | 
				
			||||||
 | 
					  postgres:
 | 
				
			||||||
							
								
								
									
										30
									
								
								compose.yml
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								compose.yml
									
									
									
									
									
								
							@ -33,7 +33,7 @@ services:
 | 
				
			|||||||
        - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
 | 
					        - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  app:
 | 
					  app:
 | 
				
			||||||
    image: nextcloud:23.0.1-fpm
 | 
					    image: nextcloud:23.0.3-fpm
 | 
				
			||||||
    depends_on:
 | 
					    depends_on:
 | 
				
			||||||
      - db
 | 
					      - db
 | 
				
			||||||
    configs:
 | 
					    configs:
 | 
				
			||||||
@ -45,10 +45,6 @@ services:
 | 
				
			|||||||
    environment:
 | 
					    environment:
 | 
				
			||||||
      - DOMAIN
 | 
					      - DOMAIN
 | 
				
			||||||
      - STACK_NAME
 | 
					      - STACK_NAME
 | 
				
			||||||
      - MYSQL_HOST=db
 | 
					 | 
				
			||||||
      - MYSQL_DATABASE=nextcloud
 | 
					 | 
				
			||||||
      - MYSQL_USER=nextcloud
 | 
					 | 
				
			||||||
      - MYSQL_PASSWORD_FILE=/run/secrets/db_password
 | 
					 | 
				
			||||||
      - NEXTCLOUD_ADMIN_USER=${ADMIN_USER}
 | 
					      - NEXTCLOUD_ADMIN_USER=${ADMIN_USER}
 | 
				
			||||||
      - NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/admin_password
 | 
					      - NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/admin_password
 | 
				
			||||||
      - NEXTCLOUD_TRUSTED_DOMAINS=${DOMAIN}
 | 
					      - NEXTCLOUD_TRUSTED_DOMAINS=${DOMAIN}
 | 
				
			||||||
@ -73,28 +69,13 @@ services:
 | 
				
			|||||||
        failure_action: rollback
 | 
					        failure_action: rollback
 | 
				
			||||||
        order: start-first
 | 
					        order: start-first
 | 
				
			||||||
      labels:
 | 
					      labels:
 | 
				
			||||||
        - "coop-cloud.${STACK_NAME}.version=1.0.0+23.0.1-fpm"
 | 
					        - "coop-cloud.${STACK_NAME}.version=1.0.0+23.0.3-fpm"
 | 
				
			||||||
 | 
					        - "backupbot.backup=true"
 | 
				
			||||||
 | 
					        - "backupbot.backup.path=/var/www/html/config/,/var/www/html/data/,/var/www/html/custom_apps/"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  db:
 | 
					 | 
				
			||||||
    image: "mariadb:10.5"
 | 
					 | 
				
			||||||
    environment:
 | 
					 | 
				
			||||||
      - MYSQL_DATABASE=nextcloud
 | 
					 | 
				
			||||||
      - MYSQL_USER=nextcloud
 | 
					 | 
				
			||||||
      - MYSQL_PASSWORD_FILE=/run/secrets/db_password
 | 
					 | 
				
			||||||
      - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
 | 
					 | 
				
			||||||
    configs:
 | 
					 | 
				
			||||||
      - source: my_tune
 | 
					 | 
				
			||||||
        target: /etc/mysql/conf.d/my-tune.cnf
 | 
					 | 
				
			||||||
    secrets:
 | 
					 | 
				
			||||||
      - db_root_password
 | 
					 | 
				
			||||||
      - db_password
 | 
					 | 
				
			||||||
    volumes:
 | 
					 | 
				
			||||||
      - "mariadb:/var/lib/mysql"
 | 
					 | 
				
			||||||
    networks:
 | 
					 | 
				
			||||||
      - internal
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  cron:
 | 
					  cron:
 | 
				
			||||||
    image: nextcloud:23.0.1-fpm
 | 
					    image: nextcloud:23.0.3-fpm
 | 
				
			||||||
    volumes:
 | 
					    volumes:
 | 
				
			||||||
      - nextcloud:/var/www/html/
 | 
					      - nextcloud:/var/www/html/
 | 
				
			||||||
      - nextapps:/var/www/html/custom_apps:cached
 | 
					      - nextapps:/var/www/html/custom_apps:cached
 | 
				
			||||||
@ -128,7 +109,6 @@ volumes:
 | 
				
			|||||||
  nextapps:
 | 
					  nextapps:
 | 
				
			||||||
  nextdata:
 | 
					  nextdata:
 | 
				
			||||||
  nextconfig:
 | 
					  nextconfig:
 | 
				
			||||||
  mariadb:
 | 
					 | 
				
			||||||
  redis:
 | 
					  redis:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
configs:
 | 
					configs:
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user