Optimize owncloud build
This commit is contained in:
parent
05a7c80d44
commit
ddf3a3376b
@ -13,43 +13,43 @@ RUN mkdir -p /run/mysqld \
|
|||||||
/run/php
|
/run/php
|
||||||
|
|
||||||
# Setup php
|
# Setup php
|
||||||
RUN sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.0/fpm/php.ini
|
RUN sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.0/fpm/php.ini &&
|
||||||
RUN sed -i "s/;env\[HOSTNAME\] = $HOSTNAME/env\[HOSTNAME\] = $HOSTNAME/g" /etc/php/7.0/fpm/pool.d/www.conf
|
sed -i "s/;env\[HOSTNAME\] = $HOSTNAME/env\[HOSTNAME\] = $HOSTNAME/g" /etc/php/7.0/fpm/pool.d/www.conf &&
|
||||||
RUN sed -i "s/;env\[PATH\] = \/usr\/local\/bin:\/usr\/bin:\/bin/env\[PATH\] = \/usr\/local\/bin:\/usr\/bin:\/bin/g" /etc/php/7.0/fpm/pool.d/www.conf
|
sed -i "s/;env\[PATH\] = \/usr\/local\/bin:\/usr\/bin:\/bin/env\[PATH\] = \/usr\/local\/bin:\/usr\/bin:\/bin/g" /etc/php/7.0/fpm/pool.d/www.conf &&
|
||||||
RUN sed -i "s/;env\[TMP\] = \/tmp/env\[TMP\] = \/tmp/g" /etc/php/7.0/fpm/pool.d/www.conf
|
sed -i "s/;env\[TMP\] = \/tmp/env\[TMP\] = \/tmp/g" /etc/php/7.0/fpm/pool.d/www.conf &&
|
||||||
RUN sed -i "s/;env\[TMPDIR\] = \/tmp/env\[TMPDIR\] = \/tmp/g" /etc/php/7.0/fpm/pool.d/www.conf
|
sed -i "s/;env\[TMPDIR\] = \/tmp/env\[TMPDIR\] = \/tmp/g" /etc/php/7.0/fpm/pool.d/www.conf &&
|
||||||
RUN sed -i "s/;env\[TEMP\] = \/tmp/env\[TEMP\] = \/tmp/g" /etc/php/7.0/fpm/pool.d/www.conf
|
sed -i "s/;env\[TEMP\] = \/tmp/env\[TEMP\] = \/tmp/g" /etc/php/7.0/fpm/pool.d/www.conf
|
||||||
|
|
||||||
# Setup nginx
|
# Setup nginx
|
||||||
RUN rm -rf /etc/nginx/sites-enabled/default
|
|
||||||
ADD owncloud /etc/nginx/sites-available/owncloud
|
ADD owncloud /etc/nginx/sites-available/owncloud
|
||||||
RUN ln -s /etc/nginx/sites-available/owncloud /etc/nginx/sites-enabled/owncloud
|
RUN rm -rf /etc/nginx/sites-enabled/default &&
|
||||||
RUN sed -i "s/\/var\/log\/nginx/\/data\/nginx-log/g" /etc/nginx/nginx.conf
|
ln -s /etc/nginx/sites-available/owncloud /etc/nginx/sites-enabled/owncloud &&
|
||||||
|
sed -i "s/\/var\/log\/nginx/\/data\/nginx-log/g" /etc/nginx/nginx.conf
|
||||||
|
|
||||||
# Setup MySQL
|
# Setup MySQL
|
||||||
RUN sed -i "s/\/var\/lib\/mysql/\/data\/mysql/g" /etc/mysql/mysql.conf.d/mysqld.cnf
|
RUN sed -i "s/\/var\/lib\/mysql/\/data\/mysql/g" /etc/mysql/mysql.conf.d/mysqld.cnf &&
|
||||||
RUN chown mysql:mysql /var/run/mysqld
|
chown mysql:mysql /var/run/mysqld
|
||||||
|
|
||||||
# Setup owncloud
|
# Setup owncloud
|
||||||
RUN rm -rf /var/www/*
|
RUN rm -rf /var/www/*
|
||||||
ADD https://download.owncloud.org/community/owncloud-${OWNCLOUD_VER}.tar.bz2 /var/www
|
ADD https://download.owncloud.org/community/owncloud-${OWNCLOUD_VER}.tar.bz2 /var/www
|
||||||
RUN tar xf /var/www/owncloud-${OWNCLOUD_VER}.tar.bz2 -C /var/www
|
RUN tar xf /var/www/owncloud-${OWNCLOUD_VER}.tar.bz2 -C /var/www &&
|
||||||
RUN mv /var/www/owncloud/* /var/www
|
mv /var/www/owncloud/* /var/www
|
||||||
RUN rm /var/www/owncloud-${OWNCLOUD_VER}.tar.bz2 \
|
rm /var/www/owncloud-${OWNCLOUD_VER}.tar.bz2 \
|
||||||
/var/www/owncloud/.htaccess \
|
/var/www/owncloud/.htaccess \
|
||||||
/var/www/owncloud/.user.ini
|
/var/www/owncloud/.user.ini &&
|
||||||
RUN rmdir /var/www/owncloud
|
rmdir /var/www/owncloud &&
|
||||||
RUN echo "*/15 * * * * www-data php -f /var/www/cron.php" >> /etc/crontab
|
echo "*/15 * * * * www-data php -f /var/www/cron.php" >> /etc/crontab
|
||||||
|
|
||||||
# Provision data
|
# Provision data
|
||||||
RUN mkdir -p /provision/owncloud
|
RUN mkdir -p /provision/owncloud &&
|
||||||
RUN cp -r /var/www/apps /provision/owncloud
|
cp -r /var/www/apps /provision/owncloud &&
|
||||||
RUN cp -r /var/www/config /provision/owncloud
|
cp -r /var/www/config /provision/owncloud &&
|
||||||
RUN rm -rf /var/www/apps \
|
rm -rf /var/www/apps \
|
||||||
/var/www/config
|
/var/www/config &&
|
||||||
RUN ln -s /data/owncloud/config /var/www
|
ln -s /data/owncloud/config /var/www &&
|
||||||
RUN ln -s /data/owncloud/apps /var/www
|
ln -s /data/owncloud/apps /var/www &&
|
||||||
RUN ln -s /data/owncloud/data /var/www
|
ln -s /data/owncloud/data /var/www
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
|
Loading…
Reference in New Issue
Block a user