Files
portainer-core/stacks/nextcloud.yml
T
jpmschweitzerandClaude Opus 4.5 64ffeda928 feat: add Redis DB tracking and resolve DB conflicts
- Add Redis DB column to All Services table in CONTAINERS.md
- Move Nextcloud from DB 3 to DB 7 to resolve conflict with Scheduler
- Split Tatlock Redis usage: DB 1 (memory), DB 6 (benchmarks)
- Add missing services to table: Wiki.js, Tatlock, Library Desk

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 14:46:21 +01:00

112 lines
3.5 KiB
YAML

services:
nextcloud:
image: nextcloud:stable
container_name: nextcloud
restart: unless-stopped
ports:
- "8082:80"
volumes:
# Fresh config directory
- /home/jpmschweitzer/docker-data/nextcloud/config:/var/www/html/config
# Fresh user data directory
- /mnt/media/nextcloud/data:/var/www/html/data
environment:
# PostgreSQL configuration
- POSTGRES_HOST=postgres-shared
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud_user
- POSTGRES_PASSWORD=${NEXTCLOUD_DB_PASSWORD}
# Redis configuration (Database 7)
- REDIS_HOST=redis-shared
- REDIS_HOST_PORT=6379
- REDIS_DB_INDEX=7
# Timezone
- TZ=Europe/Amsterdam
networks:
- docker-dataplane
deploy:
resources:
limits:
memory: 1G
networks:
docker-dataplane:
external: true
name: docker-dataplane
# Nextcloud - Personal Cloud Storage (Using Shared Infrastructure)
# Port: 8082
# GPU: No
# Dependencies: postgres-shared, redis-shared
#
# Prerequisites:
#
# 1. Shared infrastructure must be running:
# docker ps | grep -E 'postgres-shared|redis-shared'
#
# 2. Database and user already created in postgres-shared:
# - Database: nextcloud
# - User: nextcloud_user
# - Redis DB: 7
#
# 3. Create .env file with:
# NEXTCLOUD_DB_PASSWORD=<password from shared infrastructure setup>
#
# 4. Deploy this stack:
# cd /mnt/media/Projects/portainer-core/stacks
# docker compose -f nextcloud-shared.yml --env-file .env.nextcloud-shared up -d
#
# After Deployment:
#
# 1. Wait for initialization (2-3 minutes)
#
# 2. Access web interface: http://localhost:8082 or https://cloud.schweitz.net
#
# 3. First-time setup wizard:
# - Admin username: admin
# - Admin password: <STRONG_PASSWORD>
# - Data folder: /var/www/html/data (default)
# - Database: PostgreSQL
# - Database user: nextcloud_user
# - Database password: <FROM_ENV_FILE>
# - Database name: nextcloud
# - Database host: postgres-shared
#
# 4. Configure trusted domains:
# docker exec -u www-data nextcloud php occ config:system:set trusted_domains 1 --value=cloud.schweitz.net
# docker exec -u www-data nextcloud php occ config:system:set trusted_domains 2 --value=192.168.86.149
#
# 5. Configure Redis caching:
# docker exec -u www-data nextcloud php occ config:system:set redis host --value=redis-shared
# docker exec -u www-data nextcloud php occ config:system:set redis port --value=6379
# docker exec -u www-data nextcloud php occ config:system:set redis dbindex --value=7
# docker exec -u www-data nextcloud php occ config:system:set memcache.local --value='\\OC\\Memcache\\APCu'
# docker exec -u www-data nextcloud php occ config:system:set memcache.distributed --value='\\OC\\Memcache\\Redis'
# docker exec -u www-data nextcloud php occ config:system:set memcache.locking --value='\\OC\\Memcache\\Redis'
#
# 6. Optimize database:
# docker exec -u www-data nextcloud php occ db:add-missing-indices
# docker exec -u www-data nextcloud php occ db:convert-filecache-bigint
#
# 7. Configure background jobs:
# docker exec -u www-data nextcloud php occ background:cron
#
# Connection Details:
#
# Database:
# - Host: postgres-shared (from containers) / localhost (from host)
# - Port: 5432
# - Database: nextcloud
# - User: nextcloud_user
#
# Cache:
# - Host: redis-shared (from containers) / localhost (from host)
# - Port: 6379
# - Database: 7
#
# Resource Usage:
# - Nextcloud: 1GB RAM limit
# - Savings: ~110-120 MB RAM + 2 fewer containers (MariaDB + Redis removed)