2022-12-22 19:18:27 +00:00
|
|
|
# vim: ft=yaml.ansible
|
2022-12-21 21:25:10 +00:00
|
|
|
---
|
|
|
|
- name: Create Nextcloud volume directories
|
|
|
|
file:
|
2022-12-23 17:46:44 +00:00
|
|
|
name: "{{ services.nextcloud.volume }}/{{ dir.name }}"
|
|
|
|
owner: "{{ dir.owner | default('root') }}"
|
2022-12-26 11:45:54 +00:00
|
|
|
mode: "{{ dir.mode | default('u=rwx,g=rx,o=rx') }}"
|
2022-12-21 21:25:10 +00:00
|
|
|
state: directory
|
|
|
|
loop:
|
2022-12-23 17:46:44 +00:00
|
|
|
- name: apache2
|
2022-12-26 11:45:54 +00:00
|
|
|
- name: app
|
|
|
|
- name: postgres
|
|
|
|
owner: '70'
|
|
|
|
mode: u=rwx,go=
|
2022-12-21 21:25:10 +00:00
|
|
|
loop_control:
|
2022-12-22 16:58:48 +00:00
|
|
|
loop_var: dir
|
2022-12-21 21:25:10 +00:00
|
|
|
|
|
|
|
- name: Copy Apache2 config files
|
|
|
|
copy:
|
|
|
|
src: "nextcloud/apache2/{{ file }}"
|
|
|
|
dest: "{{ services.nextcloud.volume }}/apache2/{{ file }}"
|
2022-12-23 14:54:29 +00:00
|
|
|
owner: root
|
2022-12-22 16:58:48 +00:00
|
|
|
mode: u=rw,g=r,o=r
|
2022-12-21 21:25:10 +00:00
|
|
|
loop:
|
|
|
|
- apache2.conf
|
|
|
|
- remoteip.conf
|
|
|
|
loop_control:
|
|
|
|
loop_var: file
|
|
|
|
|
|
|
|
- name: Deploy Nextcloud with Docker Compose
|
|
|
|
docker_compose:
|
|
|
|
project_name: nextcloud
|
|
|
|
pull: true
|
|
|
|
definition:
|
|
|
|
version: '3.8'
|
|
|
|
|
|
|
|
services:
|
2022-12-26 11:45:54 +00:00
|
|
|
postgres:
|
|
|
|
image: "postgres:{{ services.nextcloud.postgres_version }}"
|
2022-12-21 21:25:10 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
environment:
|
2022-12-26 11:45:54 +00:00
|
|
|
POSTGRES_DB: nextcloud
|
|
|
|
POSTGRES_USER: nextcloud
|
|
|
|
POSTGRES_PASSWORD: "{{ secrets.nextcloud.postgres_pw }}"
|
2022-12-21 21:25:10 +00:00
|
|
|
volumes:
|
2022-12-26 11:45:54 +00:00
|
|
|
- "{{ services.nextcloud.volume }}/postgres:/var/lib/postgresql/data:rw"
|
2022-12-21 21:25:10 +00:00
|
|
|
|
|
|
|
redis:
|
|
|
|
image: "redis:{{ services.nextcloud.redis_version }}"
|
|
|
|
restart: unless-stopped
|
2022-12-23 17:28:01 +00:00
|
|
|
command: "redis-server --requirepass {{ secrets.nextcloud.redis_pw }}"
|
2022-12-21 21:25:10 +00:00
|
|
|
tmpfs:
|
|
|
|
- /var/lib/redis
|
|
|
|
|
|
|
|
cron:
|
|
|
|
image: "nextcloud:{{ services.nextcloud.version }}"
|
|
|
|
restart: unless-stopped
|
|
|
|
entrypoint: /cron.sh
|
|
|
|
volumes:
|
2022-12-26 11:45:54 +00:00
|
|
|
- "{{ services.nextcloud.volume }}/app:/var/www/html:rw"
|
2022-12-21 21:25:10 +00:00
|
|
|
depends_on:
|
2022-12-26 11:45:54 +00:00
|
|
|
- postgres
|
2022-12-21 21:25:10 +00:00
|
|
|
- redis
|
|
|
|
|
|
|
|
app:
|
|
|
|
image: "nextcloud:{{ services.nextcloud.version }}"
|
|
|
|
restart: unless-stopped
|
|
|
|
environment:
|
2022-12-26 11:45:54 +00:00
|
|
|
POSTGRES_HOST: postgres
|
|
|
|
POSTGRES_DB: nextcloud
|
|
|
|
POSTGRES_USER: nextcloud
|
|
|
|
POSTGRES_PASSWORD: "{{ secrets.nextcloud.postgres_pw }}"
|
2022-12-21 21:25:10 +00:00
|
|
|
REDIS_HOST: redis
|
2022-12-22 19:18:27 +00:00
|
|
|
REDIS_HOST_PASSWORD: "{{ secrets.nextcloud.redis_pw }}"
|
2022-12-21 21:25:10 +00:00
|
|
|
PHP_MEMORY_LIMIT: 2G
|
|
|
|
PHP_UPLOAD_LIMIT: 16G
|
|
|
|
volumes:
|
2022-12-26 11:45:54 +00:00
|
|
|
- "{{ services.nextcloud.volume }}/app:/var/www/html:rw"
|
2022-12-21 21:25:10 +00:00
|
|
|
- "{{ services.nextcloud.volume }}/apache2/apache2.conf:/etc/apache2/apache2.conf:ro"
|
|
|
|
- "{{ services.nextcloud.volume }}/apache2/remoteip.conf:/etc/apache2/conf-enabled/remoteip.conf:ro"
|
|
|
|
ports:
|
2022-12-22 19:18:27 +00:00
|
|
|
- '127.0.0.1:8080:80'
|
2022-12-21 21:25:10 +00:00
|
|
|
depends_on:
|
2022-12-26 11:45:54 +00:00
|
|
|
- postgres
|
2022-12-21 21:25:10 +00:00
|
|
|
- redis
|