Verified Commit 8a146726 authored by Marco Marinello's avatar Marco Marinello
Browse files

Install cron and smbclient, automatically enable apps, fix entrypoint


Signed-off-by: Marco Marinello's avatarMarco Marinello <me@marcomarinello.it>
parent e0148d77
FROM nextcloud:latest
MAINTAINER Marco Marinello <mmarinello@sezf.it>
MAINTAINER Marco Marinello <me@marcomarinello.it>
EXPOSE 80 443
RUN mkdir -p /var/www/nc_data
......@@ -7,9 +7,11 @@ RUN chown www-data. /var/www/nc_data
ENV DEBIAN_FRONTEND noninteractive
RUN apt update
RUN apt install -qy ca-certificates certbot wget
RUN apt full-upgrade -qy
RUN apt install -qy ca-certificates certbot cron smbclient wget
COPY configure-fuss.sh /
COPY crontab /etc
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/configure-fuss.sh"]
ENTRYPOINT ["/configure-fuss.sh"]
CMD ["apache2-foreground"]
#!/bin/bash
# Copyright (c) 2019 Marco Marinello <mmarinello@fuss.bz.it>
# Let /entrypoint.sh not run apache
tail -1 /entrypoint.sh 2>&1 > /dev/null | grep exec && sed -i '$ d' /entrypoint.sh
# Launch canonical entrypoint
/entrypoint.sh apache2-foreground
# Function from the Nextcloud's original entrypoint
run_as() {
if [ "$(id -u)" = 0 ]; then
......@@ -12,13 +19,13 @@ run_as() {
# Install CA certificate
mkdir -p /usr/local/share/ca-certificates/fuss.bz.it
wget -O /usr/local/share/ca-certificates/fuss.bz.it/fuss.crt http://${ACME_SERVER}/fuss-ca.crt || true
update-ca-certificates
test -e /usr/local/share/ca-certificates/fuss.bz.it/fuss.crt || (wget -O /usr/local/share/ca-certificates/fuss.bz.it/fuss.crt http://${ACME_SERVER}/fuss-ca.crt || true)
update-ca-certificates || true
# Configure certbot
# - WIP -
#certbot register --non-interactive --agree-tos -m webmaster@example.com --server https://${ACME_SERVER}:4001/acme/acme/directory
#certbot certonly --webroot -w /var/www/html -d ${NC_PRIVATE_DOMAIN} --server https://${ACME_SERVER}:4001/acme/acme/directory
#certbot certonly --webroot -w /var/www/html -d ${NC_PRIVATE_DOMAIN} --server https://${ACME_SERVER}:4001/acme/acme/directory
#
# Configure SSL
# $(find /etc/letsencrypt/live|grep {fullchain,privkey}) -> /etc/apache2/ssl.conf
......@@ -27,6 +34,10 @@ update-ca-certificates
# Enable apps
run_as 'php /var/www/html/occ app:enable user_ldap'
run_as 'php /var/www/html/occ app:enable files_external'
run_as 'php /var/www/html/occ background:cron'
# Start cron
/usr/sbin/cron
# Run the server
apache2-foreground
exec "$@"
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
* * * * * www-data php -f /var/www/html/cron.php
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment