ansible/roles/docker/tasks/services/nextcloud.yml

77 lines
2.3 KiB
YAML
Raw Permalink Normal View History

---
2022-08-31 18:10:42 +00:00
- name: upload vhost config for cloud.data.coop
2022-11-26 08:52:41 +00:00
ansible.builtin.template:
2022-08-31 18:10:42 +00:00
src: files/configs/nextcloud/vhost
2022-11-26 08:52:41 +00:00
dest: '{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.nextcloud.domain
}}'
notify: restart nginx
2022-08-31 18:10:42 +00:00
- name: setup nextcloud containers
2022-11-26 08:52:41 +00:00
community.docker.docker_compose:
project_name: nextcloud
pull: true
definition:
services:
postgres:
2022-11-26 08:52:41 +00:00
image: postgres:10
restart: unless-stopped
networks:
2022-11-26 08:52:41 +00:00
- nextcloud
volumes:
2022-11-26 08:52:41 +00:00
- '{{ services.nextcloud.volume_folder }}/postgres:/var/lib/postgresql/data'
environment:
POSTGRES_DB: nextcloud
POSTGRES_PASSWORD: '{{ postgres_passwords.nextcloud }}'
POSTGRES_USER: nextcloud
2022-11-22 16:15:59 +00:00
redis:
2022-11-26 08:52:41 +00:00
image: redis:7-alpine
restart: unless-stopped
command: redis-server --requirepass {{ nextcloud_secrets.redis_password
}}
2022-11-22 16:15:59 +00:00
tmpfs:
- /var/lib/redis
networks:
2022-11-26 08:52:41 +00:00
- nextcloud
2022-11-22 16:40:55 +00:00
cron:
2022-11-26 08:52:41 +00:00
image: nextcloud:{{ services.nextcloud.version }}
restart: unless-stopped
entrypoint: /cron.sh
2022-11-22 16:40:55 +00:00
networks:
2022-11-26 08:52:41 +00:00
- nextcloud
2022-11-22 16:40:55 +00:00
volumes:
2022-11-26 08:52:41 +00:00
- '{{ services.nextcloud.volume_folder }}/app:/var/www/html'
2022-11-22 16:40:55 +00:00
depends_on:
2022-11-26 08:52:41 +00:00
- postgres
- redis
app:
2022-11-26 08:52:41 +00:00
image: nextcloud:{{ services.nextcloud.version }}
restart: unless-stopped
networks:
2022-11-26 08:52:41 +00:00
- nextcloud
- postfix
- external_services
volumes:
2022-11-26 08:52:41 +00:00
- '{{ services.nextcloud.volume_folder }}/app:/var/www/html'
environment:
2022-11-26 08:52:41 +00:00
VIRTUAL_HOST: '{{ services.nextcloud.domain }}'
LETSENCRYPT_HOST: '{{ services.nextcloud.domain }}'
LETSENCRYPT_EMAIL: '{{ letsencrypt_email }}'
POSTGRES_HOST: postgres
POSTGRES_DB: nextcloud
POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: '{{ postgres_passwords.nextcloud }}'
REDIS_HOST: redis
REDIS_HOST_PASSWORD: '{{ nextcloud_secrets.redis_password }}'
2022-11-22 16:40:55 +00:00
depends_on:
2022-11-26 08:52:41 +00:00
- postgres
- redis
networks:
2022-11-26 08:52:41 +00:00
nextcloud:
postfix:
external: true
external_services:
external: true