change to docker compose for dumping the database
This commit is contained in:
		
							parent
							
								
									9cf4d822c3
								
							
						
					
					
						commit
						3afb539baf
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -148,7 +148,9 @@ services:
 | 
				
			||||||
    image: registry.git.base23.de/base23/backup/resticker:0.17.0
 | 
					    image: registry.git.base23.de/base23/backup/resticker:0.17.0
 | 
				
			||||||
    environment:
 | 
					    environment:
 | 
				
			||||||
      PRE_COMMANDS: |-
 | 
					      PRE_COMMANDS: |-
 | 
				
			||||||
        docker exec sso-base23-de-postgresql-1 pg_dump -U ${PG_USER:-authentik} -d ${PG_DB:-authentik} -f /var/lib/postgresql/backups/${PG_DB:-authentik}.sql
 | 
					        cd /sso.base23.de/
 | 
				
			||||||
 | 
					        if $(docker compose &>/dev/null) && [ $? -eq 0 ]; then echo "nothing to do"; else apk add --no-cache docker-cli-compose; fi
 | 
				
			||||||
 | 
					        docker compose exec postgresql pg_dump -U ${PG_USER:-authentik} -d ${PG_DB:-authentik} -f /var/lib/postgresql/backups/${PG_DB:-authentik}.sql
 | 
				
			||||||
      #RUN_ON_STARTUP: "true"
 | 
					      #RUN_ON_STARTUP: "true"
 | 
				
			||||||
      BACKUP_CRON: "32 2 * * *"
 | 
					      BACKUP_CRON: "32 2 * * *"
 | 
				
			||||||
      RESTIC_REPOSITORY: sftp://${RESTIC_REPO_USER:?Restic repository user is required}@${RESTIC_REPO_ADDRESS:?Restic repository address is requried}:${RESTIC_REPO_PORT:?Restic repository port is required}//backup
 | 
					      RESTIC_REPOSITORY: sftp://${RESTIC_REPO_USER:?Restic repository user is required}@${RESTIC_REPO_ADDRESS:?Restic repository address is requried}:${RESTIC_REPO_PORT:?Restic repository port is required}//backup
 | 
				
			||||||
| 
						 | 
					@ -167,6 +169,7 @@ services:
 | 
				
			||||||
      - ./data/restic/ssh/:/run/secrets/.ssh:ro
 | 
					      - ./data/restic/ssh/:/run/secrets/.ssh:ro
 | 
				
			||||||
      - /var/run/docker.sock:/var/run/docker.sock
 | 
					      - /var/run/docker.sock:/var/run/docker.sock
 | 
				
			||||||
      - ./docker-compose.yml:/sso.base23.de/docker-compose.yml:ro
 | 
					      - ./docker-compose.yml:/sso.base23.de/docker-compose.yml:ro
 | 
				
			||||||
 | 
					      - ./.env:/sso.base23.de/.env:ro
 | 
				
			||||||
      - backups_db:/var/lib/postgresql/backups:ro
 | 
					      - backups_db:/var/lib/postgresql/backups:ro
 | 
				
			||||||
      - ./data/authentik/certs:/var/lib/authentik/backups/certs:ro
 | 
					      - ./data/authentik/certs:/var/lib/authentik/backups/certs:ro
 | 
				
			||||||
      - ./data/authentik/custom-templates:/var/lib/authentik/backups/templates:ro
 | 
					      - ./data/authentik/custom-templates:/var/lib/authentik/backups/templates:ro
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue