[BACKUP_RESTORE] Add docker + begin implement for nextcloud service

This commit is contained in:
Florian RICHER 2023-05-21 17:51:54 +02:00
parent 1419a89d03
commit efa7c2e42d
8 changed files with 81 additions and 2 deletions

View file

@ -0,0 +1,7 @@
FROM alpine:latest
RUN apk add --update --no-cache tar
RUN mkdir -p /backup/dest
CMD ["tar", "-xf", "/backup/archive.tar.gz", "--strip-components=1", "-C", "/backup/dest"]

View file

@ -0,0 +1,5 @@
# HOW TO USE IT
```
docker run -v [PATH_TO_ARCHIVE]:/backup/archive.tar.gz -v [DIST_VOLUME]:/backup/dest volume_restore:latest
```

View file

@ -0,0 +1,18 @@
---
- name: Copy conf
ansible.builtin.copy:
backup: true
src: .
dest: volume_restore/
register: volume_restore_copy
- name: Build image
community.docker.docker_image:
name: volume_restore
tag: latest
build:
path: volume_restore
source: build
become: yes
when: volume_restore_copy.changed

View file

@ -0,0 +1,4 @@
---
- ansible.builtin.import_tasks: base.yml
name: base