Zum Inhalt springen

Nextcloud als Container

Aus Computech CMS Wiki

Setup mit Docker Compose

Neues verzeichniss anlgenen und ins neue Verzeichniss wechseln. Datei docker-compose.yml anlegen und daten anpassen. Die folgende config ist für testzwecke gedacht! Für Produktiveinsätze müssen die enviroment Variabeln auf eine sichere art und weisse eingebunden werden

version: "2.1"
services:
  db: 
    image: postgres 
    container_name: nextcloud-postgres 
    restart: always 
    volumes: 
      - postgres:/var/lib/postgresql/data 
    environment:
      - POSTGRES_PASSWORD=123456789
      - POSTGRES_USER=mige_db
      - POSTGRES_DB=nxt_db


  nextcloud:
    image: lscr.io/linuxserver/nextcloud:latest
    container_name: nextcloud
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Zurich
      - POSTGRES_DB=nxt_db
      - POSTGRES_USER=mige_db
      - POSTGRES_PASSWORD=123456789
      - NEXTCLOUD_ADMIN_USER=nxt_admin
      - NEXTCLOUD_ADMIN_PASSWORD=123456789
    links:
      - db
    depends_on: 
      - db 
    cap_add: 
      - ALL 
    volumes:
      - nextcloud_config:/config
      - nextcloud_data:/data
    ports:
      - 443:443
    restart: unless-stopped

volumes:
  postgres:
  nextcloud_config:
  nextcloud_data: