Add nextcloud config first attempt

This commit is contained in:
Samuel Ortion 2022-06-28 07:23:31 +02:00
parent 6a7c7a358e
commit 62af4d9952
7 changed files with 120 additions and 0 deletions

8
services/nextcloud/.env Normal file
View File

@ -0,0 +1,8 @@
# env for nextcloud
# Database configuration
MYSQL_ROOT_PASSWORD=qdhfkqfhkvbskdvazf
MYSQL_PASSWORD=kqddkfjkqfjqsld
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud
REDIS_PASSWORD=qdhfkqfKFVOFGJKGFKQSFJD

View File

@ -0,0 +1,6 @@
# env for nextcloud
# Database configuration
MYSQL_ROOT_PASSWORD=secret
MYSQL_PASSWORD=secret
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud

3
services/nextcloud/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
./data/
!./data/.gitkeep

View File

@ -0,0 +1,13 @@
# Nextcloud configuration
## Setup
```bash
chmod +x ./setup.sh
./setup.sh
```
## References
- [Nextcloud with docker-compose](https://stangneth.com/2022/02/02/nextcloud-with-docker-compose/)
- [Setup Nextcloud with Redis using Docker](https://markontech.com/docker/setup-nextcloud-with-redis-using-docker/)

View File

@ -0,0 +1,44 @@
---
version: '3'
volumes:
nextcloud:
db:
services:
db:
image: mariadb:latest
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
volumes:
- ./data/db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-secret}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-secret}
- MYSQL_DATABASE=${MYSQL_DATABASE:-nextcloud}
- MYSQL_USER=${MYSQL_USER:-nextcloud}
redis:
image: redis:latest
restart: always
command: redis-server --requirepass ${REDIS_PASSWORD:-secret}
app:
image: nextcloud:latest
restart: always
ports:
- "8080:80"
links:
- db
- redis
volumes:
- ./data/app/:/var/www/html
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-secret}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-secret}
- MYSQL_DATABASE=${MYSQL_DATABASE:-nextcloud}
- MYSQL_USER=${MYSQL_USER:-nextcloud}
- MYSQL_HOST=db
- REDIS_HOST_PASSWORD=${REDIS_PASSWORD:-secret}
depends_on:
- db
- redis
...

View File

@ -0,0 +1,44 @@
# nginx reverse proxy for nextcloud
server {
server_name cloud.s1gm4.eu;
listen 80;
listen [::]:80;
# Redirect to https
location / {
redirect 302 https://localhost:8080$request_uri;
}
# For dehydrated ssl certification
location /.well-known/acme-challenge {
alias /var/www/dehydrated;
}
}
server {
# SSL configuration
#
listen 443 ssl;
listen [::]:443 ssl;
#
ssl_certificate /var/www/dehydrated/certs/cloud.s1gm4.eu/fullchain.pem;
ssl_certificate_key /var/www/dehydrated/certs/cloud.s1gm4.eu/privkey.pem;
# Add index.php to the list if you are using PHP
index index.html index.htm index.php;
server_name cloud.s1gm4.eu;
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
# For dehydrated ssl certification
location /.well-known/acme-challenge {
alias /var/www/dehydrated;
}
}

2
services/nextcloud/setup.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
mkdir -p ./data/{app,db}