nextcloud/README.md

58 lines
1.5 KiB
Markdown
Raw Normal View History

2022-10-07 15:26:42 +05:00
## NextCloud Docker
2022-10-07 15:29:00 +05:00
I dont like official nextcloud docker
2022-10-08 04:31:36 +05:00
- `docker-compose.yml`
```yaml
version: '3.5'
services:
#########################
app:
2022-10-08 04:36:30 +05:00
image: git.shihaam.dev/dockerfiles/nextcloud
2022-11-04 22:37:01 +05:00
hostname: nextcloud
2022-10-08 04:31:36 +05:00
volumes:
- ./configs/init:/root/init
- ./configs/etc/nginx:/etc/nginx
- ./configs/etc/php:/etc/php
- ./configs/var/www/html/config:/var/www/html/config
- ./logs:/root/logs
- ./nextcloud:/var/www/html
- ./nextcloud-apps:/var/www/html/apps
2022-10-08 04:31:36 +05:00
- /mnt/hdd/nextcloud-data:/var/www/html/data #CHANGE MOUNT POINT FOR THIS
ports:
- 8000:80
#########################
db:
image: mysql:8
environment:
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
MYSQL_PASSWORD: nextcloud
MYSQL_ALLOW_EMPTY_PASSWORD: true
volumes:
- ./database:/var/lib/mysql
```
2022-10-08 04:47:01 +05:00
- You must use a reverse proxy with SSL before starting to setup, personally i use nginx with certbot. \
here is my nginx config
```nginx
server {
server_name nextcloud.shihaam.me; #Change this to your domain
listen 80;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
- SSL with certbot
```bash
sudo certbot --nginx -d nextcloud.shihaam.me
```
- Configure your DNS accordingly and then.. thats it, enjoy.