Add nextcloud config first attempt
This commit is contained in:
parent
6a7c7a358e
commit
62af4d9952
8
services/nextcloud/.env
Normal file
8
services/nextcloud/.env
Normal 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
|
6
services/nextcloud/.env.example
Normal file
6
services/nextcloud/.env.example
Normal 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
3
services/nextcloud/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
./data/
|
||||||
|
|
||||||
|
!./data/.gitkeep
|
13
services/nextcloud/README.md
Normal file
13
services/nextcloud/README.md
Normal 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/)
|
44
services/nextcloud/docker-compose.yml
Normal file
44
services/nextcloud/docker-compose.yml
Normal 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
|
||||||
|
...
|
44
services/nextcloud/nginx.conf
Normal file
44
services/nextcloud/nginx.conf
Normal 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
2
services/nextcloud/setup.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
mkdir -p ./data/{app,db}
|
Loading…
Reference in New Issue
Block a user