Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds server based on latest master #84

Merged
merged 1 commit into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions server/init.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
7 changes: 7 additions & 0 deletions server/php.ini
Original file line number Diff line number Diff line change
@@ -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