ansible-role-docker_nextcloud/templates/docker-compose.yml

59 lines
1.8 KiB
YAML
Raw Normal View History

2022-08-05 15:29:05 +02:00
# {{ 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 %}
2022-08-05 15:29:05 +02:00
restart: always
depends_on:
db:
condition: service_healthy
2022-08-05 15:29:05 +02:00
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 }}
- OVERWRITEPROTOCOL=https
- OVERWRITECLIURL=https://{{ docker_nextcloud_fqdn }}
- TRUSTED_PROXIES={{ docker_nextcloud_trusted_proxies }}
2022-08-05 15:29:05 +02:00
db:
image: postgres:14
2022-08-05 15:29:05 +02:00
restart: always
shm_size: 256mb
networks:
- nextcloud
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
2022-08-05 15:29:05 +02:00
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:
traefik:
external: true
nextcloud:
internal: true