2022-12-22 19:18:27 +00:00
|
|
|
# vim: ft=yaml.ansible
|
2022-12-21 21:25:10 +00:00
|
|
|
---
|
2023-01-25 21:35:38 +00:00
|
|
|
- name: Create Nextcloud apache2 directory
|
2022-12-21 21:25:10 +00:00
|
|
|
file:
|
2023-01-25 21:35:38 +00:00
|
|
|
name: "{{ services.nextcloud.volume }}/apache2"
|
|
|
|
owner: root
|
|
|
|
mode: u=rwx,g=rx,o=rx
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: Create Nextcloud app directory
|
|
|
|
file:
|
|
|
|
name: "{{ services.nextcloud.volume }}/app"
|
|
|
|
owner: root
|
|
|
|
group: '33'
|
|
|
|
mode: u=rwx,g=rx,o=rx
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: Create Nextcloud PostgreSQL directory
|
|
|
|
file:
|
|
|
|
name: "{{ services.nextcloud.volume }}/postgres"
|
|
|
|
owner: '70'
|
|
|
|
mode: u=rwx,go=
|
2022-12-21 21:25:10 +00:00
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: Copy Apache2 config files
|
|
|
|
copy:
|
2023-01-03 21:30:22 +00:00
|
|
|
src: nextcloud/apache2/{{ file }}
|
2022-12-21 21:25:10 +00:00
|
|
|
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:
|
2023-01-03 21:30:22 +00:00
|
|
|
image: postgres:{{ services.nextcloud.postgres_version }}
|
2023-01-14 18:25:13 +00:00
|
|
|
restart: always
|
2022-12-21 21:25:10 +00:00
|
|
|
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:
|
2023-01-03 21:30:22 +00:00
|
|
|
image: redis:{{ services.nextcloud.redis_version }}
|
2023-01-14 18:25:13 +00:00
|
|
|
restart: always
|
2023-01-03 21:30:22 +00:00
|
|
|
command: redis-server --requirepass {{ secrets.nextcloud.redis_pw }}
|
2022-12-21 21:25:10 +00:00
|
|
|
tmpfs:
|
|
|
|
- /var/lib/redis
|
|
|
|
|
|
|
|
app:
|
2023-01-03 21:30:22 +00:00
|
|
|
image: nextcloud:{{ services.nextcloud.version }}
|
2023-01-14 18:25:13 +00:00
|
|
|
restart: always
|
2022-12-21 21:25:10 +00:00
|
|
|
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 }}"
|
2023-01-14 17:45:25 +00:00
|
|
|
MAIL_FROM_ADDRESS: noreply
|
|
|
|
MAIL_DOMAIN: "{{ services.nextcloud.domain }}"
|
2023-01-14 18:12:34 +00:00
|
|
|
SMTP_AUTHTYPE: PLAIN
|
2023-01-14 17:45:25 +00:00
|
|
|
SMTP_HOST: postfix
|
|
|
|
SMTP_PORT: 587
|
2023-01-14 18:12:34 +00:00
|
|
|
TRUSTED_PROXIES: 172.16.3.2
|
|
|
|
OVERWRITEHOST: "{{ services.nextcloud.domain }}"
|
|
|
|
OVERWRITEPROTOCOL: https
|
|
|
|
OVERWRITECLIURL: https://{{ services.nextcloud.domain }}
|
|
|
|
NEXTCLOUD_INIT_LOCK: 'true'
|
2022-12-21 21:25:10 +00:00
|
|
|
PHP_MEMORY_LIMIT: 2G
|
|
|
|
PHP_UPLOAD_LIMIT: 16G
|
2022-12-28 16:51:02 +00:00
|
|
|
networks:
|
2022-12-28 17:24:27 +00:00
|
|
|
default:
|
2023-01-14 17:06:21 +00:00
|
|
|
postfix:
|
2022-12-28 17:24:27 +00:00
|
|
|
services:
|
|
|
|
aliases:
|
|
|
|
- nextcloud
|
2022-12-21 21:25:10 +00:00
|
|
|
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"
|
|
|
|
depends_on:
|
2022-12-26 11:45:54 +00:00
|
|
|
- postgres
|
2022-12-21 21:25:10 +00:00
|
|
|
- redis
|
2022-12-28 16:51:02 +00:00
|
|
|
|
2023-01-14 18:12:34 +00:00
|
|
|
cron:
|
|
|
|
image: nextcloud:{{ services.nextcloud.version }}
|
2023-01-14 18:25:13 +00:00
|
|
|
restart: always
|
2023-01-14 18:12:34 +00:00
|
|
|
entrypoint: /cron.sh
|
|
|
|
volumes:
|
|
|
|
- "{{ services.nextcloud.volume }}/app:/var/www/html:rw"
|
|
|
|
depends_on:
|
|
|
|
- app
|
|
|
|
|
2022-12-28 16:51:02 +00:00
|
|
|
networks:
|
2023-01-14 17:06:21 +00:00
|
|
|
postfix:
|
|
|
|
external: true
|
2022-12-28 16:51:02 +00:00
|
|
|
services:
|
|
|
|
external: true
|