76 lines
2.3 KiB
Django/Jinja

services:
{% include 'templates/docker/services/redis.yml.j2' %}
{% include 'templates/docker/services/' + database_type + '.yml.j2' %}
application:
image: "nextcloud:{{nextcloud_version}}-fpm-alpine"
container_name: nextcloud-application
restart: {{docker_restart_policy}}
logging:
driver: journald
volumes:
- data:/var/www/html
environment:
# Database Configuration
MYSQL_DATABASE: "{{database_name}}"
MYSQL_USER: "{{database_username}}"
MYSQL_PASSWORD: "{{database_password}}"
MYSQL_HOST: {{database_host}}:3306
# Memory
PHP_MEMORY_LIMIT: 1G # Required for plugin duplicate finder
# Email Configuration
SMTP_HOST: {{system_email_host}}
SMTP_SECURE: {{ 'ssl' if system_email_start_tls else 'tls' }}
SMTP_PORT: {{system_email_smtp_port}}
SMTP_NAME: {{system_email_username}}
SMTP_PASSWORD: {{system_email_password}}
# Email from configuration
# MAIL_FROM_ADDRESS: no-reply
# MAIL_DOMAIN: {{domain}}
At least SMTP_HOST, MAIL_FROM_ADDRESS and MAIL_DOMAIN must be set for the configurations to be applied.
{% include 'templates/docker/container/depends-on-database-redis.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
web:
image: nginx:alpine
container_name: nextcloud-web
logging:
driver: journald
restart: {{docker_restart_policy}}
ports:
- "127.0.0.1:{{http_port}}:80"
volumes:
- "{{path_docker_volumes}}nextcloud/nginx.conf:/etc/nginx/nginx.conf:ro"
volumes_from:
- application
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/"]
interval: 1m
timeout: 10s
retries: 3
{% include 'templates/docker/container/networks.yml.j2' %}
cron:
container_name: nextcloud-cron
image: "nextcloud:{{nextcloud_version}}-fpm-alpine"
restart: {{docker_restart_policy}}
logging:
driver: journald
volumes:
- data:/var/www/html
entrypoint: /cron.sh
{% include 'templates/docker/container/depends-on-database-redis.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
{% include 'templates/docker/compose/volumes.yml.j2' %}
data:
redis:
{% include 'templates/docker/compose/networks.yml.j2' %}