feat (service): add Nextcloud service
This commit is contained in:
parent
934a0390ad
commit
e8f564ce4d
4 changed files with 120 additions and 0 deletions
38
proxy/nginx/conf.d/nextcloud.conf
Normal file
38
proxy/nginx/conf.d/nextcloud.conf
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
# HTTP configuration
|
||||||
|
# -- Redirect all HTTP requests to HTTPS port
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name nextcloud.systemsobscure.net;
|
||||||
|
location / {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# HTTPS configuration
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
server_name nextcloud.systemsobscure.net;
|
||||||
|
|
||||||
|
# SSL configuration
|
||||||
|
ssl_certificate /etc/letsencrypt/live/systemsobscure.net/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/systemsobscure.net/privkey.pem;
|
||||||
|
|
||||||
|
# Security headers
|
||||||
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||||
|
|
||||||
|
# Set max upload size
|
||||||
|
client_max_body_size 10G;
|
||||||
|
|
||||||
|
|
||||||
|
# Proxy Configuration
|
||||||
|
location / {
|
||||||
|
proxy_pass http://nextcloud_app_1:80;
|
||||||
|
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;
|
||||||
|
proxy_read_timeout 3600;
|
||||||
|
}
|
||||||
|
}
|
5
services/nextcloud/README.md
Normal file
5
services/nextcloud/README.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
Run local version
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker compose -f docker-compose.local.yml up -d
|
||||||
|
```
|
34
services/nextcloud/docker-compose.dev.yml
Normal file
34
services/nextcloud/docker-compose.dev.yml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: mariadb:10.6
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- nextcloud-db:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||||
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
|
- MYSQL_DATABASE=nextcloud
|
||||||
|
- MYSQL_USER=nextcloud
|
||||||
|
|
||||||
|
app:
|
||||||
|
image: nextcloud:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "8080:80" # Expose port 8080 locally for direct access
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
volumes:
|
||||||
|
- nextcloud-config:/var/www/html/config
|
||||||
|
- nextcloud-data:/var/www/html/data
|
||||||
|
environment:
|
||||||
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
|
- MYSQL_DATABASE=nextcloud
|
||||||
|
- MYSQL_USER=nextcloud
|
||||||
|
- MYSQL_HOST=db
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
nextcloud-db:
|
||||||
|
nextcloud-config:
|
||||||
|
nextcloud-data:
|
43
services/nextcloud/docker-compose.yml
Normal file
43
services/nextcloud/docker-compose.yml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: mariadb:10.6
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- nextcloud-db:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||||
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
|
- MYSQL_DATABASE=nextcloud
|
||||||
|
- MYSQL_USER=nextcloud
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
|
||||||
|
app:
|
||||||
|
image: nextcloud:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
volumes:
|
||||||
|
- nextcloud-config:/var/www/html/config
|
||||||
|
- nextcloud-data:/var/www/html/data
|
||||||
|
environment:
|
||||||
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
|
- MYSQL_DATABASE=nextcloud
|
||||||
|
- MYSQL_USER=nextcloud
|
||||||
|
- MYSQL_HOST=db
|
||||||
|
- TRUSTED_PROXIES=nginx
|
||||||
|
- OVERWRITEPROTOCOL=https
|
||||||
|
- OVERWRITEHOST=${NEXTCLOUD_DOMAIN}
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
- web
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
nextcloud-db:
|
||||||
|
nextcloud-config:
|
||||||
|
nextcloud-data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
web:
|
||||||
|
external: true
|
Loading…
Add table
Reference in a new issue