Compose-Examples/examples/nextcloud/docker-compose-mariadb-redis.yml

70 lines
2.2 KiB
YAML

services:
nextcloud-db:
image: mariadb
container_name: nextcloud-db
hostname: nextcloud-db
command: --transaction-isolation=READ-COMMITTED --innodb_read_only_compressed=OFF
restart: unless-stopped
volumes:
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/nextcloud/database:/var/lib/mysql
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE:-nextcloud}
- MYSQL_USER=${MYSQL_USER:-nextcloud}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-nextcloud}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-nextcloud-root-pw}
- MYSQL_INITDB_SKIP_TZINFO=1
- MARIADB_AUTO_UPGRADE=1
- PUID=${MYSQL_PUID:-1000}
- PGID=${MYSQL_PGID:-1000}
- TZ=${MSQL_TZ:-Europe/Berlin}
#networks:
# - proxy
nextcloud-redis:
image: redis:alpine
container_name: nextcloud-redis
hostname: nextcloud-redis
restart: unless-stopped
command:
- /bin/sh
- -c
- redis-server --requirepass "$${REDIS_PASSWORD:-nextcloud}"
#networks:
# - proxy
nextcloud-app:
image: nextcloud
container_name: nextcloud-app
hostname: nextcloud-app
restart: unless-stopped
expose:
- 80/tcp
ports:
- 8080:80
depends_on:
- nextcloud-db
- nextcloud-redis
environment:
- TRUSTED_PROXIES=${NC_TRUSTED_PROXIES:-127.0.0.1/32}
- PUID=${NC_PUID:-1000}
- PGID=${NC_PGID:-1000}
- OVERWRITEPROTOCOL=${NC_OVERWRITEPROTOCOL:-http}
- OVERWRITECLIURL=${NC_OVERWRITECLIURL:-http://127.0.0.1:8080}
- OVERWRITEHOST=${NC_OVERWRITEHOST:-127.0.0.1:8080}
- MYSQL_HOST=${MYSQL_HOST:-nextcloud-db}
- MYSQL_DATABASE=${MYSQL_DATABASE:-nextcloud}
- MYSQL_USER=${MYSQL_USER:-nextcloud}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-nextcloud}
- REDIS_HOST=${REDIS_HOST:-nextcloud-redis}
- REDIS_HOST_PASSWORD=${REDIS_PASSWORD:-nextcloud}
healthcheck:
test: ["CMD-SHELL", "curl -Ss http://localhost/status.php | grep '\"installed\":true' || exit 1"]
interval: 2m
retries: 10
start_period: 10m
timeout: 5s
volumes:
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/nextcloud/data:/var/www/html/data
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/nextcloud/app:/var/www/html