feat (service): add Nextcloud service

This commit is contained in:
thomasabishop 2025-03-21 17:05:18 +00:00
parent 934a0390ad
commit e8f564ce4d
4 changed files with 120 additions and 0 deletions

View 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;
}
}

View file

@ -0,0 +1,5 @@
Run local version
```sh
docker compose -f docker-compose.local.yml up -d
```

View 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:

View 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