51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
# {{ ansible_managed }}
|
|
version: '3.1'
|
|
|
|
services:
|
|
nextcloud:
|
|
image: nextcloud:{{ docker_nextcloud_version }}
|
|
volumes:
|
|
- {{ docker_nextcloud_data_dir }}/{{ docker_nextcloud_service_id }}/nextcloud:/var/www/html
|
|
- ./php.ini:/usr/local/etc/php/php.ini
|
|
{% if docker_nextcloud_custom_volumes is defined %}
|
|
{% for volume in docker_nextcloud_custom_volumes %}
|
|
- {{ volume.volume }}:{{ volume.target }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
restart: always
|
|
depends_on:
|
|
- db
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.docker.network=traefik"
|
|
- "traefik.http.routers.{{ docker_nextcloud_service_id }}.entrypoints=web"
|
|
- "traefik.http.routers.{{ docker_nextcloud_service_id }}.rule=Host(`{{ docker_nextcloud_fqdn }}`)"
|
|
- "traefik.http.services.{{ docker_nextcloud_service_id }}.loadbalancer.server.port=80"
|
|
networks:
|
|
- nextcloud
|
|
- traefik
|
|
environment:
|
|
- POSTGRES_HOST=db
|
|
- POSTGRES_DB={{ docker_nextcloud_db }}
|
|
- POSTGRES_USER={{ docker_nextcloud_db_user }}
|
|
- POSTGRES_PASSWORD={{ docker_nextcloud_db_password }}
|
|
- SMTP_HOST={{ docker_nextcloud_smtp_host }}
|
|
|
|
db:
|
|
image: postgres:13
|
|
restart: always
|
|
volumes:
|
|
- {{ docker_nextcloud_data_dir }}/{{ docker_nextcloud_service_id }}/db:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_DB={{ docker_nextcloud_db }}
|
|
- POSTGRES_USER={{ docker_nextcloud_db_user }}
|
|
- POSTGRES_PASSWORD={{ docker_nextcloud_db_password }}
|
|
networks:
|
|
- nextcloud
|
|
|
|
|
|
networks:
|
|
traefik:
|
|
external: true
|
|
nextcloud:
|
|
internal: true
|