touch docker-compose.yml
https://gist.github.com/ichiTechs/83e228fa1e6c83543623a1bf06f3eb32#file-docker-compose-yml
root@Next:~/nextcloud# cat docker-compose.yml
version: '2'
services:
nextcloud:
container_name: nextcloud
restart: unless-stopped
image: nextcloud
ports:
- 80:80
volumes:
- /next:/var/www/
depends_on:
- db
db:
container_name: maria-db
restart: unless-stopped
image: mariadb
command: --innodb-read-only-compressed=OFF
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ncdb
MYSQL_USER: nextcloud
MYSQL_PASSWORD: nextcloud
volumes:
- /root/nextcloud/db:/var/lib/mysql
啟動所有的 Docker Container 指令如下
$ docker-compose up -d