initial impl
All checks were successful
the build was successful

This commit is contained in:
Jan Christian Grünhage 2018-01-28 11:12:19 +01:00
parent 45701cdff3
commit 305f104455
Signed by: jcgruenhage
GPG key ID: 6594C449C633D10C
3 changed files with 106 additions and 0 deletions

11
.drone.yml Normal file
View file

@ -0,0 +1,11 @@
pipeline:
download:
image: docker.io/fedora
commands:
- curl https://download.nextcloud.com/server/releases/nextcloud-12.0.5.tar.bz2 > nextcloud.tar.bz2
docker:
image: plugins/docker
repo: docker.jcg.re/rainloop
registry: docker.jcg.re
secrets: [ docker_username, docker_password ]
tags: latest

53
Caddyfile Normal file
View file

@ -0,0 +1,53 @@
:8888
root /nextcloud
log /log/access.log
errors /log/errors.log
fastcgi / /tmp/php-fpm.sock php {
env PATH /bin
}
# checks for images
rewrite {
ext .svg .gif .png .html .ttf .woff .ico .jpg .jpeg
r ^/index.php/(.+)$
to /{1} /index.php?{1}
}
rewrite {
r ^/index.php/.*$
to /index.php?{query}
}
# client support (e.g. os x calendar / contacts)
redir /.well-known/carddav /remote.php/carddav 301
redir /.well-known/caldav /remote.php/caldav 301
# remove trailing / as it causes errors with php-fpm
rewrite {
r ^/remote.php/(webdav|caldav|carddav|dav)(\/?)$
to /remote.php/{1}
}
rewrite {
r ^/remote.php/(webdav|caldav|carddav|dav)/(.+?)(\/?)$
to /remote.php/{1}/{2}
}
rewrite {
r ^/public.php/(.+?)(\/?)$
to /public.php/(.+?)(\/?)$
}
# .htaccess / data / config / ... shouldn't be accessible from outside
status 403 {
/.htacces
/data
/config
/db_structure
/.xml
/README
/log
}
header / Strict-Transport-Security "max-age=31536000;"

42
Dockerfile Normal file
View file

@ -0,0 +1,42 @@
FROM docker.jcg.re/base-php
ADD nextcloud.tar.bz2 /nextcloud
RUN apk add --no-cache \
php7-ctype \
php7-dom \
php7-gd \
php7-iconv \
php7-json \
php7-xml \
php7-mbstring \
php7-posix \
php7-simplexml \
php7-xmlreader \
php7-xmlwriter \
php7-zip \
php7-zlib \
php7-pdo_sqlite \
php7-pdo_mysql \
php7-pdo_pgsql \
php7-curl \
php7-fileinfo \
php7-bz2 \
php7-intl \
php7-mcrypt \
php7-openssl \
php7-ldap \
php7-ftp \
php7-imap \
php7-exif \
php7-gmp \
php7-apcu \
php7-memcached \
php7-redis \
php7-imagick \
php7-pcntl \
ffmpeg \
&& mv nextcloud/nextcloud/* nextcloud \
&& mkdir log \
&& chmod -R a+rw log \
&& sed -i "s#/phpapp#/nextcloud#" /etc/Caddyfile \
&& sed -i "s#/phpapp#/nextcloud#" /etc/s6.d/php/run
COPY Caddyfile /etc/Caddyfile