ansible-role-docker_nextcloud/templates/docker-compose.yml
2022-08-05 15:29:05 +02:00

46 lines
1.4 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
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