feat: add Nextcloud service configuration and deployment tasks
This commit is contained in:
parent
3e48b16a61
commit
27649f31fc
@ -29,3 +29,5 @@
|
||||
enabled: false
|
||||
- name: jellyfin
|
||||
enabled: true
|
||||
- name: nextcloud
|
||||
enabled: true
|
||||
|
@ -17,3 +17,8 @@ jf.vleeuwen.me jf.mvl.sh {
|
||||
reverse_proxy jellyfin:8096
|
||||
tls {{ caddy_email }}
|
||||
}
|
||||
|
||||
cloud.vleeuwen.me cloud.mvl.sh {
|
||||
reverse_proxy nextcloud-aio-mastercontainer:80
|
||||
tls {{ caddy_email }}
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
services:
|
||||
nextcloud-aio-mastercontainer:
|
||||
image: nextcloud/all-in-one:latest
|
||||
init: true
|
||||
restart: always
|
||||
container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed as otherwise AIO will not work correctly
|
||||
volumes:
|
||||
- /mnt/object_storage/services/nextcloud:/mnt/docker-aio-config # This line is not allowed to be changed as otherwise the built-in backup solution will not work
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro # May be changed on macOS, Windows or docker rootless. See the applicable documentation. If adjusting, don't forget to also set 'WATCHTOWER_DOCKER_SOCKET_PATH'!
|
||||
network_mode: bridge # add to the same network as docker run would do
|
||||
ports:
|
||||
- 8080:8080
|
||||
networks:
|
||||
- caddy_network
|
||||
|
||||
networks:
|
||||
caddy_network:
|
||||
external: true
|
||||
name: caddy_default
|
@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Deploy Nextcloud service
|
||||
block:
|
||||
- name: Set Nextcloud directories
|
||||
ansible.builtin.set_fact:
|
||||
nextcloud_service_dir: "{{ ansible_env.HOME }}/services/nextcloud"
|
||||
nextcloud_data_dir: "/mnt/object_storage/services/nextcloud"
|
||||
|
||||
- name: Create Nextcloud directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ nextcloud_service_dir }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Deploy Nextcloud docker-compose.yml
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ nextcloud_service_dir }}/docker-compose.yml"
|
||||
mode: "0644"
|
||||
register: nextcloud_compose
|
||||
|
||||
- name: Stop Nextcloud service
|
||||
ansible.builtin.command: docker compose -f "{{ nextcloud_service_dir }}/docker-compose.yml" down --remove-orphans
|
||||
when: nextcloud_compose.changed
|
||||
|
||||
- name: Start Nextcloud service
|
||||
ansible.builtin.command: docker compose -f "{{ nextcloud_service_dir }}/docker-compose.yml" up -d
|
||||
when: nextcloud_compose.changed
|
Loading…
x
Reference in New Issue
Block a user