-
-
Save techc0de/b81a6c4d2fe3c97d18b9a77cb4347f5d to your computer and use it in GitHub Desktop.
NextCloud with Maria DB docker-compose file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NextCLoud with MariaDB/MySQL | |
# | |
# Access via "http://localhost:80" (or "http://$(docker-machine ip):80" if using docker-machine) | |
# | |
# During initial NextCLoud setup, select "Storage & database" --> "Configure the database" --> "MySQL/MariaDB" | |
# Database user: nextcloud | |
# Database password: nextcloud | |
# Database name: ncdb | |
# Database host: replace "localhost" with "maria-db" the same name as the data base container name. | |
# | |
# | |
# The reason for the more refined data persistence in the volumes is because if you were to | |
# use just the the '/var/www/html' then everytime you would want/need to update/upgrade | |
# NextCloud you would have to go into the volume on the host machine and delete 'version.php' | |
# | |
version: '2' | |
services: | |
nextcloud: | |
container_name: nextcloud | |
restart: unless-stopped | |
image: nextcloud | |
ports: | |
- 80:80 | |
volumes: | |
- /containers/cloud/nextcloud/apps:/var/www/html/apps | |
- /containers/cloud/nextcloud/config:/var/www/html/config | |
- /containers/cloud/nextcloud/data:/var/www/html/data | |
depends_on: | |
- db | |
db: | |
container_name: maria-db | |
restart: unless-stopped | |
image: mariadb | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: ncdb | |
MYSQL_USER: nextcloud | |
MYSQL_PASSWORD: nextcloud | |
volumes: | |
- /containers/cloud/mariadb:/var/lib/mysql | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment