Skip to content

Instantly share code, notes, and snippets.

@dudefoxlive
Created December 28, 2022 00:32
Show Gist options
  • Save dudefoxlive/a8e63c90831edda8a2ae728aab4e8299 to your computer and use it in GitHub Desktop.
Save dudefoxlive/a8e63c90831edda8a2ae728aab4e8299 to your computer and use it in GitHub Desktop.
docker compose nextcloud
---
version: '2'
services:
db:
container_name: nc_database
image: mariadb:10.5
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- /path/to/config:/var/lib/mysql
environment:
# Make this something long and strong. This is the root database password
- MYSQL_ROOT_PASSWORD=
# This is the nextcloud database password that Nextcloud will use to auth against MariaDB
- MYSQL_PASSWORD=
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
nextcloud:
container_name: nextcloud
image: nextcloud
restart: unless-stopped
ports:
# Make sure the left number does not interfere with any other ports. This will cause the container to fail to start if it does.
- 8080:80
links:
- db
volumes:
- /path/to/config:/var/www/html
environment:
# Make this the same as the MYSQL_PASSWORD in the DB section. DO NOT SET IT AS MYSQL_ROOT_PASSWORD
- MYSQL_PASSWORD=
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
depends_on:
- db
cron:
image: nextcloud
restart: unless-stopped
volumes:
- /path/to/config:/var/www/html
entrypoint: /cron.sh
depends_on:
- db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment