Hi, I’m a student who want to build a private storage cloud, my test OS is Ubuntu 20.04. here’s my problem:
When I use official .yml file and change DB to the mysql, and set the external path in db’s volumes, it can work. like this:
version: '3'
volumes:
nextcloud:
db:
services:
db:
image: mysql
restart: always
command: --default-authentication-plugin=mysql_native_password
volumes:
- ~/docker/mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=12345678
- MYSQL_PASSWORD=nextcloud
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
app:
image: nextcloud
restart: always
ports:
- 8080:80
links:
- db
volumes:
- nextcloud:/var/www/html
- /etc/localtime:/etc/localtime:ro
environment:
- MYSQL_PASSWORD=nextcloud
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
but when I want to set the hostpath on the app’s volumes, the server can not work, and show
the message like this:
app:
image: nextcloud
restart: always
ports:
- 8080:80
links:
- db
volumes:
- nextcloud:/var/www/html
- ./app/data:/var/www/html/data
- /etc/localtime:/etc/localtime:ro
environment:
- MYSQL_PASSWORD=nextcloud
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
how to give the webserver write access to the root directory?
My final gold is to set the app’s volumes like this:
app:
image: nextcloud
restart: always
ports:
- 8080:80
links:
- db
volumes:
- nextcloud:/var/www/html
- ./app:/var/www/html
- ./app/config:/var/www/html/config
- ./app/custom_apps:/var/www/html/custom_apps
- ./app/data:/var/www/html/data
- ./app/themes:/var/www/html/themes
- /etc/localtime:/etc/localtime:ro
environment:
- MYSQL_PASSWORD=nextcloud
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
Thank you & Best Regards!