Compare commits
	
		
			4 Commits
		
	
	
		
			9.1.0+29.0
			...
			add-postgr
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ea48f6837c | |||
| dba042ff46 | |||
| 27e8e62675 | |||
| 559ca6a95c | 
| @ -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 | ||||||
|  | |||||||
							
								
								
									
										40
									
								
								compose.mariadb.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								compose.mariadb.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,40 @@ | |||||||
|  | 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/" | ||||||
|  | configs: | ||||||
|  |   my_tune: | ||||||
|  |     name: ${STACK_NAME}_my_cnf_${MY_CNF_VERSION} | ||||||
|  |     file: my-tune.cnf | ||||||
|  |  | ||||||
|  | volumes: | ||||||
|  |   mariadb: | ||||||
							
								
								
									
										38
									
								
								compose.postgres.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								compose.postgres.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,38 @@ | |||||||
|  | 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 | ||||||
|  |     deploy: | ||||||
|  |       labels: | ||||||
|  |             backupbot.backup: "true" | ||||||
|  |             backupbot.backup.pre-hook: "mkdir -p /tmp/backup/ && PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /tmp/backup/backup.sql" | ||||||
|  |             backupbot.backup.post-hook: "rm -rf /tmp/backup" | ||||||
|  |             backupbot.backup.path: "/tmp/backup/" | ||||||
|  |  | ||||||
|  | volumes: | ||||||
|  |   postgres: | ||||||
							
								
								
									
										33
									
								
								compose.yml
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								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=2.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: | ||||||
| @ -139,9 +119,6 @@ configs: | |||||||
|   fpm_tune: |   fpm_tune: | ||||||
|     name: ${STACK_NAME}_fpm_tune_${FPM_TUNE_VERSION} |     name: ${STACK_NAME}_fpm_tune_${FPM_TUNE_VERSION} | ||||||
|     file: fpm-tune.ini |     file: fpm-tune.ini | ||||||
|   my_tune: |  | ||||||
|     name: ${STACK_NAME}_my_cnf_${MY_CNF_VERSION} |  | ||||||
|     file: my-tune.cnf |  | ||||||
|  |  | ||||||
| networks: | networks: | ||||||
|   proxy: |   proxy: | ||||||
|  | |||||||
							
								
								
									
										6
									
								
								releases/2.0.0+23.0.3-fpm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								releases/2.0.0+23.0.3-fpm
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,6 @@ | |||||||
|  | 2.0.0 introduces a minor nextcloud update to 23.0.3 and moves the database service to a seperate override.yml file to support different database types (mariadb / postgres). This might break your installation. Please add the following snippet to your config .env to ensure the right db is used: | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | COMPOSE_FILE="compose.yml" | ||||||
|  | COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml" | ||||||
|  | ``` | ||||||
		Reference in New Issue
	
	Block a user