mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-05-12 07:09:17 +00:00
owncloud: move base to alpine
This commit is contained in:
parent
964feb5cb5
commit
8de10a4c17
@ -1,44 +1,38 @@
|
||||
FROM debian:jessie
|
||||
MAINTAINER Wonderfall <wonderfall@mondedie.fr>
|
||||
FROM alpine:3.3
|
||||
MAINTAINER Wonderfall <wonderfall@schrodinger.io>
|
||||
|
||||
ARG VERSION=9.0.1
|
||||
ARG TINI_VER=0.9.0
|
||||
ENV GID=991 UID=991
|
||||
|
||||
ENV USERID=1000 GROUPID=1000
|
||||
|
||||
ADD https://www.dotdeb.org/dotdeb.gpg /tmp/dotdeb.gpg
|
||||
ADD http://nginx.org/keys/nginx_signing.key /tmp/nginx.key
|
||||
|
||||
RUN echo "deb http://packages.dotdeb.org jessie all" > /etc/apt/sources.list.d/dotdeb.list \
|
||||
&& echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" > /etc/apt/sources.list.d/nginx.list \
|
||||
&& echo "deb-src http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list.d/nginx.list \
|
||||
&& apt-key add /tmp/dotdeb.gpg \
|
||||
&& apt-key add /tmp/nginx.key
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||
cron \
|
||||
RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
|
||||
&& echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
||||
&& echo "@edge http://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
|
||||
&& apk -U add \
|
||||
nginx \
|
||||
openssl \
|
||||
supervisor \
|
||||
php7.0-fpm \
|
||||
php7.0-cli \
|
||||
php7.0-intl \
|
||||
php7.0-curl \
|
||||
php7.0-gd \
|
||||
php7.0-mcrypt \
|
||||
php7.0-mysql \
|
||||
php7.0-apcu \
|
||||
php7.0-apcu-bc \
|
||||
&& mkdir /run/php && touch /run/php/php7.0-fpm.sock \
|
||||
&& chown www-data:www-data /run/php/php7.0-fpm.sock \
|
||||
&& sed -i "s/;env\[PATH\]/env\[PATH\]/g" /etc/php/7.0/fpm/pool.d/www.conf \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests \
|
||||
bzip2 \
|
||||
wget \
|
||||
gnupg \
|
||||
tar \
|
||||
openssl \
|
||||
ca-certificates \
|
||||
tini@commuedge \
|
||||
libwebp@edge \
|
||||
php7@testing \
|
||||
php7-fpm@testing \
|
||||
php7-intl@testing \
|
||||
php7-curl@testing \
|
||||
php7-gd@testing \
|
||||
php7-mcrypt@testing \
|
||||
php7-opcache@testing \
|
||||
php7-json@testing \
|
||||
php7-session@testing \
|
||||
php7-pdo@testing \
|
||||
php7-dom@testing \
|
||||
php7-ctype@testing \
|
||||
php7-iconv@testing \
|
||||
php7-pdo_mysql@testing \
|
||||
php7-zlib@testing \
|
||||
php7-zip@testing \
|
||||
php7-xmlreader@testing \
|
||||
&& mkdir /owncloud && cd /tmp \
|
||||
&& wget -q https://download.owncloud.org/community/owncloud-$VERSION.tar.bz2 \
|
||||
&& wget -q https://download.owncloud.org/community/owncloud-$VERSION.tar.bz2.sha256 \
|
||||
@ -48,18 +42,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends --no-install-su
|
||||
&& gpg --import owncloud.asc \
|
||||
&& gpg --verify owncloud-$VERSION.tar.bz2.asc \
|
||||
&& tar xjf /tmp/owncloud-$VERSION.tar.bz2 --strip 1 -C /owncloud \
|
||||
&& wget -q https://github.com/krallin/tini/releases/download/v$TINI_VER/tini_$TINI_VER.deb \
|
||||
&& dpkg -i tini_$TINI_VER.deb \
|
||||
&& apt-get purge -y wget bzip2 ca-certificates && apt-get autoremove -y --purge \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
|
||||
&& sed -i "s/;env\[PATH\]/env\[PATH\]/g" /etc/php7/php.ini \
|
||||
&& apk del tar ca-certificates gnupg \
|
||||
&& rm -rf /var/cache/apk/* /tmp/*
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY supervisord.conf /etc/supervisord.conf
|
||||
COPY cron.conf /etc/cron.conf
|
||||
COPY opcache.ini /etc/php/mods-available/opcache.ini
|
||||
COPY php-fpm.conf /etc/php7/php-fpm.conf
|
||||
COPY opcache.ini /etc/php7/conf.d/00_opcache.ini
|
||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
||||
COPY run.sh /usr/local/bin/run.sh
|
||||
COPY cron /etc/periodic/15min/owncloud
|
||||
|
||||
RUN chmod +x /usr/local/bin/run.sh
|
||||
RUN chmod +x /usr/local/bin/run.sh /etc/periodic/15min/owncloud
|
||||
|
||||
VOLUME /data /config /apps2
|
||||
EXPOSE 80
|
||||
|
2
owncloud/cron
Normal file
2
owncloud/cron
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
su - owncloud -c "php7 -f /owncloud/cron.php" > /dev/null 2>&1
|
@ -1 +0,0 @@
|
||||
*/15 * * * * php -f /owncloud/cron.php > /dev/null 2>&1
|
@ -1,4 +1,4 @@
|
||||
user www-data;
|
||||
user owncloud;
|
||||
worker_processes auto;
|
||||
pid /var/run/nginx.pid;
|
||||
daemon off;
|
||||
@ -91,7 +91,7 @@ http {
|
||||
fastcgi_param modHeadersAvailable true;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$1;
|
||||
fastcgi_param PATH_INFO $2;
|
||||
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
|
||||
fastcgi_pass unix:/var/run/php-fpm.sock;
|
||||
}
|
||||
|
||||
location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
|
||||
|
@ -1,5 +1,3 @@
|
||||
; configuration for php opcache module
|
||||
; priority=10
|
||||
zend_extension=opcache.so
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
|
17
owncloud/php-fpm.conf
Normal file
17
owncloud/php-fpm.conf
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
[global]
|
||||
daemonize = no
|
||||
|
||||
[www]
|
||||
user = owncloud
|
||||
group = owncloud
|
||||
listen = /var/run/php-fpm.sock
|
||||
listen.owner = owncloud
|
||||
listen.group = owncloud
|
||||
pm = dynamic
|
||||
pm.max_children = 5
|
||||
pm.start_servers = 2
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 3
|
||||
chdir = /
|
||||
request_terminate_timeout = 300
|
@ -1,8 +1,5 @@
|
||||
#!/bin/bash
|
||||
deluser www-data
|
||||
addgroup --gid $GROUPID www-data
|
||||
adduser --system --no-create-home --ingroup www-data --uid $USERID www-data
|
||||
crontab -u www-data /etc/cron.conf
|
||||
#!/bin/sh
|
||||
addgroup -g ${GID} owncloud && adduser -h /owncloud -s /bin/sh -D -G owncloud -u ${UID} owncloud
|
||||
|
||||
if [ -f /owncloud/config/config.php ] && [ ! -f /config/config.php ]; then
|
||||
cp /owncloud/config/config.php /config/config.php
|
||||
@ -14,7 +11,8 @@ elif [ -f /config/config.php ]; then
|
||||
cp /config/config.php /owncloud/config/config.php
|
||||
fi
|
||||
|
||||
chown -R www-data:www-data /owncloud /data /config /apps2
|
||||
touch /var/run/php-fpm.sock
|
||||
chown -R owncloud:owncloud /owncloud /data /config /apps2 /var/run/php-fpm.sock /var/lib/nginx /tmp
|
||||
ln -s /apps2 /owncloud
|
||||
|
||||
supervisord -c /etc/supervisord.conf
|
||||
supervisord -c /etc/supervisor/supervisord.conf
|
||||
|
@ -2,10 +2,10 @@
|
||||
nodaemon=true
|
||||
|
||||
[program:cron]
|
||||
command=cron -f
|
||||
command=crond -f
|
||||
|
||||
[program:php-fpm]
|
||||
command=php-fpm7.0 --nodaemonize
|
||||
command=php-fpm7
|
||||
|
||||
[program:nginx]
|
||||
command=nginx
|
||||
|
Loading…
x
Reference in New Issue
Block a user