ansible-role-nextcloud-docker/templates/docker-compose.yml.j2

91 lines
2.0 KiB
Django/Jinja

# {{ ansible_managed }}
# commit: {{ lookup('pipe', 'git rev-parse --short HEAD') }}
version: "3.4"
services:
nextcloud:
image: nextcloud:{{ nextcloud_version }}-fpm-alpine
container_name: {{ nc_app_host }}
hostname: {{ nc_app_host }}
restart: unless-stopped
depends_on:
- nextcloud-postgres
- nextcloud-redis
volumes:
- data:/var/www/html
networks:
- internal
- external # TODO: remove this when it's fixed
env_file:
- postgres.env
- nextcloud.env
environment:
POSTGRES_HOST: "nextcloud-postgres:5432"
REDIS_HOST: "nextcloud-redis"
nextcloud-nginx:
build: ./web
container_name: {{ nc_nginx_host }}
hostname: {{ nc_nginx_host }}
restart: always
ports:
- "127.0.0.1:{{ nextcloud_port }}:80"
volumes:
- data:/var/www/html:ro
networks:
- external
- internal
depends_on:
- nextcloud
nextcloud-cron:
image: nextcloud:{{ nextcloud_version }}-fpm-alpine
container_name: nextcloud-cron
hostname: nextcloud-cron
restart: unless-stopped
volumes:
- data:/var/www/html
networks:
- internal
- external
entrypoint: /cron.sh
depends_on:
- nextcloud-postgres
- nextcloud-redis
nextcloud-redis:
image: redis:{{ nextcloud_redis_version }}-alpine
container_name: nextcloud-redis
hostname: nextcloud-redis
restart: unless-stopped
volumes:
- redis:/bitnami/redis/data
networks:
- internal
env_file:
- redis.env
command: redis-server --requirepass {{ nextcloud_redis_host_pw }} # unfortunately, this is necessary
nextcloud-postgres:
image: postgres:{{nextcloud_postgres_version}}-alpine
container_name: nextcloud-postgres
hostname: nextcloud-postgres
restart: unless-stopped
volumes:
- postgres:/var/lib/postgresql/data
networks:
- internal
env_file:
- postgres.env
networks:
external:
internal:
internal: true
volumes:
data:
postgres:
redis: