mirror of
				https://github.com/tborychowski/self-hosted-cookbook.git
				synced 2025-11-03 23:37:32 +00:00 
			
		
		
		
	
		
			
				
	
	
	
		
			3.3 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			3.3 KiB
		
	
	
	
	
	
	
	
NextCloud
- Mobile apps are just for files, not other apps (e.g. tasks) installed in NextCloud.
 
docker-compose.yml
More examplex here.
---
services:
  app:
    image: nextcloud:latest
    container_name: nextcloud
    restart: unless-stopped
    links:
      - db
      - redis
    ports:
      - 3100:80
    environment:
      - MYSQL_PASSWORD=nextcloud
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
      - TRUSTED_PROXIES=               # e.g. HOST IP
      - OVERWRITEPROTOCOL=https
      - OVERWRITEHOST=nextcloud.domain.com
      - REDIS_HOST=redis
      - REDIS_HOST_PASSWORD=nextcloud  # must be set, because of a bug
    volumes:
      - ./nextcloud:/var/www/html
  cron:
    image: nextcloud:latest
    restart: unless-stopped
    volumes:
      - ./nextcloud:/var/www/html
    entrypoint: /cron.sh
    depends_on:
      - db
      - redis
  db:
    image: mariadb
    container_name: nextcloud-db
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: unless-stopped
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=nextcloud
      - MYSQL_PASSWORD=nextcloud
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
	  - MARIADB_AUTO_UPGRADE=1
	  - MARIADB_DISABLE_UPGRADE_BACKUP=1
  redis:
    image: redis:alpine
    container_name: nextcloud-redis
    restart: unless-stopped
    command: redis-server --requirepass nextcloud
    environment:
      - TZ=Europe/Dublin
    volumes:
      - ./redis:/data
    expose:
      - 6379
Tips & Tricks
Generate password/secret key
openssl rand -base64 32
Enable HEIC & MOV previews
- Make sure that Preview Generator app is installed
 - Add this section to the 
config.php 
  'enable_previews' => true,
  'enabledPreviewProviders' => [
    'OC\Preview\PNG',
    'OC\Preview\JPEG',
    'OC\Preview\GIF',
    'OC\Preview\HEIC',
    'OC\Preview\BMP',
    'OC\Preview\XBitmap',
    'OC\Preview\MP3',
    'OC\Preview\TXT',
    'OC\Preview\MarkDown',
    'OC\Preview\OpenDocument',
    'OC\Preview\Krita',
    'OC\Preview\Movie',
    'OC\Preview\MKV',
    'OC\Preview\MP4',
    'OC\Preview\AVI',
    'OC\Preview\MSOffice2003',
    'OC\Preview\MSOffice2007',
    'OC\Preview\MSOfficeDoc',
    'OC\Preview\PDF',
    'OC\Preview\SVG',
  ],
- If you don't see the previews, try running this command:
 
docker-compose exec -u www-data app bash -c ."/occ preview:generate-all -vvv"
- For video previews you need to install ffmpeg, like so:
 
docker-compose exec app bash -c "apt update && apt upgrade -y && apt install -y ffmpeg"
# optionally add imagemagick and ghostscript
- This will not persist so it must be run every time the container restarts...
 - Alternative is to manually build docker image :-|
 
Bookmarks previews
For bookmarks previews it's required to have a screenshotting service. Screenly can be easily self-hosted.