Updated Nextcloud version.

Added reverse proxy configuration.
Added optional Nextcloud objectstore configuration.
Added Nextcloud mime configuration.
Added Nextcloud https configuration.
Fixed elasticsearch getting killed when "stop" or "down" is used: due to a docker bug, the new script stop.sh, must be used instead.
This commit is contained in:
yohan 2019-12-04 21:41:54 +01:00
parent 2a9d9b80d8
commit ed1f45e8ed
9 changed files with 103 additions and 4 deletions

View File

@ -6,7 +6,7 @@ services:
container_name: nextcloud-full
image: nextcloud:16.0.6
build: ./docker/.examples/dockerfiles/full/apache/
restart: always
restart: unless-stopped
networks:
- reverse-proxy
- mysqlnet
@ -15,7 +15,8 @@ services:
- "80/tcp"
volumes:
- nextcloud:/var/www/html:Z
- ./www-data:/var/spool/cron/crontabs/www-data
- ./supervisord.conf:/etc/supervisor/supervisord.conf
- ./run_elasticsearch.sh:/run_elasticsearch.sh
networks:

7
mimetypemapping.json Normal file
View File

@ -0,0 +1,7 @@
{
"_comment" : "Array mapping file extensions to mimetypes (in alphabetical order)",
"_comment2": "The first index in the mime type array is the assumed correct mimetype",
"_comment3": "and the second (if present) is a secure alternative",
"kdbx": ["application/x-keepass2"]
}

19
objectstore.config.php Normal file
View File

@ -0,0 +1,19 @@
<?php
$CONFIG = array (
'objectstore' => array(
'class' => '\\OC\\Files\\ObjectStore\\Swift',
'arguments' => array(
'username' => 'FIXME',
'password' => 'FIXME',
// the container to store the data in
'bucket' => 'Nextcloud_Files',
'autocreate' => false,
'region' => 'GRA7',
// The Identity / Keystone endpoint
'url' => 'https://auth.cloud.ovh.net/v2.0',
// optional on some swift implementations
'tenantName' => 'FIXME',
'serviceName' => 'swift',
),
),
);

8
reverse-proxy-cloud.conf Normal file
View File

@ -0,0 +1,8 @@
<VirtualHost *:80>
ServerName cloud.scimetis.net
ServerAdmin postmaster@scimetis.net
ProxyPreserveHost on
ProxyPass / http://nextcloud/
ProxyPassReverse / http://nextcloud/
ProxyRequests Off
</VirtualHost>

4
reverse-proxy.config.php Normal file
View File

@ -0,0 +1,4 @@
<?php
$CONFIG = array (
'overwriteprotocol' => 'https',
);

11
run_elasticsearch.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
pgrep -af fulltextsearch | grep -qv grep || { su -c "php /var/www/html/occ fulltextsearch:index -q" -s "/bin/bash" www-data; }
pgrep -af fulltextsearch | grep -qv grep || nohup su -c "php /var/www/html/occ fulltextsearch:live -q" -s "/bin/bash" www-data &>/dev/null &
trap "{ echo EXITING; pkill -f -SIGTERM 'fulltextsearch'; }" SIGKILL SIGTERM
while pgrep -af fulltextsearch | grep -qv grep:
do
sleep 1 # This script is not really doing anything.
done

22
stop.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
sudo docker-compose kill -s SIGTERM
COUNT=1
ATTEMPT=0
while [ $COUNT -ne 0 ] && [ $ATTEMPT -lt 10 ]
do
sleep 1
COUNT=$(sudo docker-compose top | wc -l)
ATTEMPT=$(( $ATTEMPT + 1 ))
done
if [ $COUNT -eq 0 ]
then
sudo docker-compose down
exit 0
else
echo "ERROR: Some containers are still running"
sudo docker-compose ps
exit 1
fi

29
supervisord.conf Normal file
View File

@ -0,0 +1,29 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisord/supervisord.log
pidfile=/var/run/supervisord/supervisord.pid
childlogdir=/var/log/supervisord/
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error
[program:apache2]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=apache2-foreground
[program:cron]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=/cron.sh
[program:run_elasticsearch]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=/run_elasticsearch.sh

View File

@ -1,2 +0,0 @@
*/15 * * * * php -f /var/www/html/cron.php
*/1 * * * * pgrep -af fulltextsearch | grep -qv grep || { php /var/www/html/occ fulltextsearch:index -q; php /var/www/html/occ fulltextsearch:live -q; }