this post was submitted on 01 Sep 2023
10 points (91.7% liked)

Nextcloud

326 readers
1 users here now

A community for discussing all things related to Nextcloud.

Other resources:

founded 1 year ago
MODERATORS
 
services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - ./mysql:/var/lib/mysql
    environment:
      - MYSQL_PASSWORD=supersecretpassword
      - MYSQL_DATABASE=nextclouddb
      - MYSQL_USER=nextclouduser
      - MYSQL_RANDOM_ROOT_PASSWORD='yes'

  redis:

    image: redis

    restart: always

    command: redis-server --requirepass supersecretpassword2

  app:
    image: nextcloud:27
    restart: always
    ports:
      - 8080:80
    links:
      - db
      - redis
    volumes:
      - ./html:/var/www/html
    environment:
      - MYSQL_PASSWORD=supersecretpassword
      - MYSQL_DATABASE=nextclouddb
      - MYSQL_USER=nextclouduser
      - MYSQL_HOST=db
      - REDIS_HOST_PASSWORD=supersecretpassword2
    depends_on:
      - db
      - redis
  cron:
    image: nextcloud:27
    restart: always
    volumes:
      - ./html:/var/www/html
    entrypoint: /cron.sh
    depends_on:
      - db

To use this you need docker-compose installed. Once thats installed create a nextcloud folder and copy in this file as docker-compose.yaml. Once you are in the working directory run docker-compose up -d

top 3 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 1 year ago (2 children)

This guide does not include the setup of a secure connection, e.g. with traefic and letsencrypt. This is recommended when the nextcloud instance is reachable from the internet.

[–] [email protected] 2 points 1 year ago

That was deliberate. You need to take more security precautions when exposing it to the internet. Firewalls and least privlage are a must

[–] [email protected] 1 points 1 year ago

The title says quick and dirty. Besides, you can always keep this kind of thing behind some Nginx proxy like nginx-proxy-manager (and probably should)