diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 00000000..8d3fda95 --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:stretch + +RUN apt-get update \ + && apt-get install -y \ + php \ + php-curl \ + php-gd \ + php-imagick \ + php-mbstring \ + php-pdo-mysql \ + php-pdo-pgsql \ + php-redis \ + php-sqlite3 \ + php-xml \ + php-zip \ + git \ + && apt-get autoremove -y \ + && apt-get autoclean \ + && apt-get clean \ + && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* + +COPY php.ini /etc/php/7.0/apache2/conf.d/30-php.ini + +WORKDIR /var/www/html + +RUN rm index.html +RUN git clone https://github.com/nextcloud/server.git . +RUN git submodule update --init + +RUN chown -R www-data:www-data . +RUN chsh -s /bin/bash www-data + +ADD init.sh /initnc.sh +RUN chmod +x /initnc.sh + +EXPOSE 80 +ENTRYPOINT /initnc.sh \ No newline at end of file diff --git a/server/init.sh b/server/init.sh new file mode 100644 index 00000000..4cc88654 --- /dev/null +++ b/server/init.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +export BRANCH=${BRANCH:=master} + +#Where we do all the work +cd /var/www/html/ + +#Update code +su www-data -c " +git checkout ${BRANCH} +git pull +git submodule update + +#init +php occ maintenance:install --admin-user=admin --admin-pass=admin +OC_PASS=test php occ user:add --password-from-env -- test + +#Trusted domains +php occ config:system:set trusted_domains 1 --value=* +" + +set -e + +. /etc/apache2/envvars + +apache2 -DFOREGROUND "$@" \ No newline at end of file diff --git a/server/php.ini b/server/php.ini new file mode 100644 index 00000000..f588f0c3 --- /dev/null +++ b/server/php.ini @@ -0,0 +1,7 @@ +opcache.enable=1 +opcache.enable_cli=1 +opcache.interned_strings_buffer=8 +opcache.max_accelerated_files=10000 +opcache.memory_consumption=128 +opcache.save_comments=1 +opcache.revalidate_freq=1 \ No newline at end of file