2020-12-24 14:27:31 +01:00
|
|
|
---
|
|
|
|
- name: recieve {{domain}} certificate
|
|
|
|
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
|
|
|
|
|
|
|
|
- name: configure {{domain}}.conf
|
|
|
|
template: src=templates/nextcloud.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
|
|
|
|
notify: restart nginx
|
|
|
|
|
2021-08-17 22:19:29 +02:00
|
|
|
- name: "create /usr/local/bin/docker-nextcloud/"
|
|
|
|
file:
|
|
|
|
path: "/usr/local/bin/docker-nextcloud"
|
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
- name: configure nginx.conf
|
|
|
|
template: src=templates/nginx.conf.j2 dest=/usr/local/bin/docker-nextcloud/nginx.conf
|
|
|
|
notify: restart nginx
|
|
|
|
|
2020-12-24 14:27:31 +01:00
|
|
|
- name: "setup nextcloud"
|
|
|
|
docker_compose:
|
|
|
|
project_name: nextcloud
|
|
|
|
definition:
|
|
|
|
application:
|
2021-08-18 16:16:14 +02:00
|
|
|
image: "nextcloud:{{nextcloud_version}}-fpm-alpine"
|
2020-12-24 14:27:31 +01:00
|
|
|
restart: always
|
2020-12-31 15:50:05 +01:00
|
|
|
log_driver: journald
|
2020-12-24 14:27:31 +01:00
|
|
|
links:
|
|
|
|
- database
|
|
|
|
volumes:
|
|
|
|
- nextcloud-data:/var/www/html
|
2021-08-18 16:16:14 +02:00
|
|
|
# Maybe error in following line
|
2021-08-17 22:19:29 +02:00
|
|
|
expose:
|
|
|
|
- "9000"
|
2020-12-24 14:27:31 +01:00
|
|
|
environment:
|
2021-08-18 01:51:00 +02:00
|
|
|
COMPOSE_HTTP_TIMEOUT: 120
|
2021-08-18 17:36:33 +02:00
|
|
|
DOCKER_CLIENT_TIMEOUT: 120
|
2020-12-24 14:27:31 +01:00
|
|
|
MYSQL_DATABASE: "nextcloud"
|
|
|
|
MYSQL_USER: "nextcloud"
|
|
|
|
MYSQL_PASSWORD: "{{nextcloud_database_password}}"
|
|
|
|
MYSQL_HOST: database:3306
|
|
|
|
database:
|
2020-12-31 15:50:05 +01:00
|
|
|
log_driver: journald
|
2020-12-24 14:27:31 +01:00
|
|
|
image: mariadb
|
|
|
|
environment:
|
2021-08-18 17:36:33 +02:00
|
|
|
COMPOSE_HTTP_TIMEOUT: 120
|
|
|
|
DOCKER_CLIENT_TIMEOUT: 120
|
2020-12-24 14:27:31 +01:00
|
|
|
MYSQL_DATABASE: "nextcloud"
|
|
|
|
MYSQL_USER: "nextcloud"
|
|
|
|
MYSQL_PASSWORD: "{{nextcloud_database_password}}"
|
|
|
|
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
|
|
|
|
volumes:
|
|
|
|
- nextcloud-database:/var/lib/mysql
|
|
|
|
restart: always
|
|
|
|
expose:
|
|
|
|
- "3306"
|
2021-08-17 22:19:29 +02:00
|
|
|
web:
|
|
|
|
image: nginx:alpine
|
|
|
|
log_driver: journald
|
|
|
|
restart: always
|
|
|
|
ports:
|
|
|
|
- "127.0.0.1:{{http_port}}:80"
|
|
|
|
links:
|
|
|
|
- application
|
|
|
|
volumes:
|
|
|
|
- /usr/local/bin/docker-nextcloud/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
|
|
volumes_from:
|
|
|
|
- application
|
|
|
|
redis:
|
|
|
|
image: redis:alpine
|
|
|
|
restart: always
|
|
|
|
cron:
|
|
|
|
image: nextcloud:fpm-alpine
|
|
|
|
restart: always
|
|
|
|
volumes:
|
|
|
|
- nextcloud:/var/www/html
|
|
|
|
entrypoint: /cron.sh
|
|
|
|
# depends_on:
|
|
|
|
# - database
|
|
|
|
# - redis
|