docker/owncloud/Dockerfile

45 lines
1.4 KiB
Text
Raw Normal View History

2017-06-27 21:00:27 +00:00
FROM ubuntu:16.04
2017-06-27 21:22:22 +00:00
MAINTAINER Przemek Grondek <github@nerull7.info>
2017-07-09 22:25:40 +00:00
ENV OWNCLOUD_VER 10.0.2
2017-06-27 21:22:22 +00:00
ENV DEBIAN_FRONTEND noninteractive
2017-07-09 22:25:40 +00:00
RUN apt-get update && \
apt-get install -y nginx mysql-server php-fpm php-mysql php-gd php-json php-curl php-intl php-mcrypt php-imagick php-zip php-xml php-mbstring php-smbclient pwgen bzip2 gosu supervisor && \
apt-get clean
# Make required catalogs
2017-07-11 18:27:36 +00:00
RUN mkdir -p /run/mysqld \
2017-07-09 22:25:40 +00:00
/run/php
# Setup php
RUN sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.0/fpm/php.ini
# Setup nginx
RUN rm -rf /etc/nginx/sites-enabled/default
ADD owncloud /etc/nginx/sites-available/owncloud
RUN ln -s /etc/nginx/sites-available/owncloud /etc/nginx/sites-enabled/owncloud
RUN sed -i "s/\/var\/log\/nginx/\/data\/nginx-log/g" /etc/nginx/nginx.conf
# Setup MySQL
RUN sed -i "s/\/var\/lib\/mysql/\/data\/mysql/g" /etc/mysql/mysql.conf.d/mysqld.cnf
2017-07-11 18:27:36 +00:00
RUN chown mysql:mysql /var/run/mysqld
2017-07-09 22:25:40 +00:00
# Setup owncloud
RUN rm -rf /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 mv /var/www/owncloud/* /var/www
RUN rm /var/www/owncloud-${OWNCLOUD_VER}.tar.bz2 \
/var/www/owncloud/.htaccess \
/var/www/owncloud/.user.ini
RUN rmdir /var/www/owncloud
EXPOSE 80
VOLUME ["/data"]
COPY run.sh /
COPY supervisord.conf /
CMD ["/run.sh"]