Add Micro Configurations (#18)

* Begin changing files to recommendations rather than actual contents, that way multiple examples can be shown and when they are changed to be the real .yml they are not added to the project.

* Shrink the PHP limits more.

* Convert all configurations to be micro/standard.

* Double check the script supports IPv6. Shrink case statement.

* Fix uncommented nc-oo.

* Shrink NC further.

* Change name of env example.

* Change name of env example.

* Do not provide micro versions of DNS or PhotoPrism.

* Fix error in NC checks, wants at least 512M.

* Shrink more.

* Add a folder to keep static resources.

* Copy static resources into the container. This unfortunately doubles the size right now. Maybe do a volume in the future.

* Bring the description up to date.

* Make the description slightly more agnostic.

* Be more consistent about using variable.
This commit is contained in:
2024-01-24 11:05:44 +00:00
committed by GitHub
parent 08a4d93282
commit fa892cb3bd
17 changed files with 280 additions and 40 deletions

View File

@ -0,0 +1,103 @@
# Nextcloud configuration.
# This is a revised version of the original work here:
# https://hub.docker.com/_/nextcloud
# Changelog:
# 2023-07-16
# Change from mariadb:10.5 to 10.6.
# 2023-08-20
# Add Redis. (https://markontech.com/docker/setup-nextcloud-with-redis-using-docker/)
# 2023-08-21
# Got NC to work with OO after specifying the Advanced parameters!
# 2023-08-26
# Try combining OnlyOffice to here again. It has been on its own since
# 2023-07-25 but isn't being used for anything else. OO is slow to respond
# and upgrades can no longer be done separately but this keeps it all easier
# to maintain and may allow the internal address to be based on container
# name instead of the docker hosts's IP.
# 2024-01-23
# Experimenting with how small a Nextcloud installation can survive.
version: '3'
services:
## MariaDB ##
nc-db:
container_name: nc-db
image: mariadb:10.6
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- ../../Volumes/Nextcloud/mariadb:/var/lib/mysql
environment:
- MYSQL_DATABASE=$MYSQL_DATABASE
- MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
- MYSQL_USER=$MYSQL_USER
- MYSQL_PASSWORD=$MYSQL_PASSWORD
deploy:
mode: global
resources:
limits:
cpus: '0.20'
memory: 64M
## Redis ##
nc-redis:
container_name: nc-redis
image: redis
restart: always
command: redis-server --requirepass $REDIS_HOST_PASSWORD
deploy:
mode: global
resources:
limits:
cpus: '0.10'
memory: 32M
### OnlyOffice ##
##nc-oo:
## container_name: nc-oo
## image: onlyoffice/documentserver
## restart: always
## ports:
## - 8081:80
## environment:
## - JWT_SECRET=$JWT_SECRET
## deploy:
## mode: global
## resources:
## limits:
## cpus: '0.75'
## memory: 1G
## Nextcloud ##
nc-app:
container_name: nc-app
image: nextcloud
restart: always
ports:
- 8080:80
links:
- nc-db
- nc-redis
## - nc-oo
volumes:
- ../../Volumes/Nextcloud/nextcloud:/var/www/html
environment:
- NEXTCLOUD_ADMIN_USER=$NEXTCLOUD_ADMIN_USER
- NEXTCLOUD_ADMIN_PASSWORD=$NEXTCLOUD_ADMIN_PASSWORD
- PHP_MEMORY_LIMIT=$PHP_MEMORY_LIMIT
- PHP_UPLOAD_LIMIT=$PHP_UPLOAD_LIMIT
- MYSQL_HOST=$MYSQL_HOST
- MYSQL_DATABASE=$MYSQL_DATABASE
- MYSQL_USER=$MYSQL_USER
- MYSQL_PASSWORD=$MYSQL_PASSWORD
- REDIS_HOST=$REDIS_HOST
- REDIS_HOST_PASSWORD=$REDIS_HOST_PASSWORD
deploy:
mode: global
resources:
limits:
cpus: '0.30'
memory: 512M

View File

@ -0,0 +1,55 @@
# Example environment file for Nextcloud stack, should be copied as `.env`. The
# variables here only apply to the compose file. If you need it passed to a
# container then it also needs specified in its `environment:` operator.
#
# ** All usernames and passwords need changed before running in production! **
#
# Full guide on the Nextcloud parameters which may be supplied:
# https://github.com/docker-library/docs/blob/master/nextcloud/README.md#auto-configuration-via-environment-variables
#
## Nextcloud ##
#
NEXTCLOUD_ADMIN_USER=nc_admin
NEXTCLOUD_ADMIN_PASSWORD=SuperDuperSecretPassword
PHP_MEMORY_LIMIT=512M
PHP_UPLOAD_LIMIT=512M
#
## MariaDB ##
#
# Should load automatically the first run. Then config.php is the source of
# truth for these values. So, if something like the DB password is changed,
# updating it here will have no effect. This is only used for the install.
MYSQL_HOST=nc-db
MYSQL_DATABASE=nextcloud
MYSQL_ROOT_PASSWORD=ChangeMe
MYSQL_USER=nc
MYSQL_PASSWORD=changeme
#
## Redis ##
#
# Installs automagically if both of these parameters are supplied.
REDIS_HOST=nc-redis
REDIS_HOST_PASSWORD=someredispassword
###
#### OnlyOffice ##
###
### How Nextcloud's ONLYOFFICE Admin Settings should be set up:
### OO Address: https://FQDN-For-Reverse-Proxied-OO-Server
### OO Secret: Contents-Of-$JWT_SECRET
### OO Header:
### OO Internal Address: http://docker-server-ip:8081 ?OR http://nc-oo:8081?
### NC Internal Address: http://docker-server-ip:8080 ?OR http://nc-app:8080?
###
### Documentation which references the variable(s) below, Nextcloud link does not cover them:
### https://helpcenter.onlyoffice.com/installation/docs-configure-jwt.aspx
##
### Secret key which is used above in the Nextcloud ONLYOFFICE Administration UI.
##JWT_SECRET=abc123