Files
self-hosted-docker-setups/nextcloud/compose.yaml
2024-08-19 13:39:19 +01:00

73 lines
2.5 KiB
YAML

services:
db:
image: arm64v8/mariadb:10.5
container_name: nextcloud_db
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- type: volume
source: db
target: /var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=<secure-root-password> # Change this
- MYSQL_PASSWORD=<password> # Change this
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
redis:
image: redis:alpine
container_name: nextcloud_redis
command: redis-server --requirepass <secure-password> . # Change this
restart: always
app:
image: nextcloud
container_name: nextcloud_app
ports:
- target: 80
published: 8088 # Serving on port 8088, change if you'd like a different port
protocol: tcp
volumes:
- type: bind
source: /mnt/nfs-share/Nextcloud
target: /var/www/html # Change this to where you would like Nextcloud data (preferably external storage)
environment:
- MYSQL_HOST=db
- MYSQL_PASSWORD=<password> # Change this (same as defined in `db`)
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- REDIS_HOST=redis
- REDIS_HOST_PASSWORD=<secure-password> . # Change this (same as defined in `redis`)
- NEXTCLOUD_ADMIN_USER=ncadmin # Change this
- NEXTCLOUD_ADMIN_PASSWORD=<admin-password> # Change this
- NEXTCLOUD_HOSTNAME=cloud.example.com # Change this
- SMTP_HOST=smtp.gmail.com # Using gmail's smtp server for emails
- SMTP_SECURE=tls
- SMTP_PORT=587
- SMTP_AUTHTYPE=LOGIN
- SMTP_NAME=<gmail-user> # Change this
- SMTP_PASSWORD=<gmail-password> # Change this
- MAIL_FROM_ADDRESS=<gmail-address> # Change this
- MAIL_DOMAIN=gmail.com
restart: always
depends_on:
- db
- redis
cron:
image: nextcloud
container_name: nextcloud_cron
restart: always
volumes:
- type: bind
source: /mnt/nfs-share/Nextcloud
target: /var/www/html # Point to nextcloud data directory
entrypoint: /cron.sh
depends_on:
- db
- redis
volumes:
nextcloud:
db: