Created
March 19, 2014 05:22
-
-
Save btobolaski/9635889 to your computer and use it in GitHub Desktop.
Docker based install of Owncloud. It uses persistent data using a mounted directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/owncloud | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /var/www/owncloud> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
LogLevel warn | |
</VirtualHost> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<sudo> docker build -t 'name/owncloud' . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d -m 1g -p 127.0.0.1:9000:80 --name="owncloud" -v /var/owncloud:/var/www/owncloud/data btobolaski/owncloud |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:12.04 | |
MAINTAINER Brendan Tobolaski "[email protected]" | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" >> /etc/apt/sources.list | |
RUN apt-get -y update | |
RUN dpkg-divert --local --rename --add /sbin/initctl | |
RUN apt-get install -y apache2 php5 php5-gd php-xml-parser php5-intl php5-mysqlnd php5-json php5-mcrypt smbclient curl libcurl3 php5-curl bzip2 wget | |
RUN curl http://download.owncloud.org/community/owncloud-6.0.2.tar.bz2 | tar jx -C /var/www/ | |
RUN chown -R www-data:www-data /var/www/owncloud | |
ADD ./001-owncloud.conf /etc/apache2/sites-available/ | |
RUN rm -f /etc/apache2/sites-enabled/000* | |
RUN ln -s /etc/apache2/sites-available/001-owncloud.conf /etc/apache2/sites-enabled/ | |
RUN a2enmod rewrite | |
VOLUME ["/var/www/owncloud/data"] | |
EXPOSE 80 | |
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name owncloud.example.com; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443; | |
server_name owncloud.example.com; | |
ssl on; | |
ssl_certificate /etc/ssl/private/example_com.cert; | |
ssl_certificate_key /etc/ssl/private/example_com.key; | |
location / { | |
proxy_pass http://127.0.0.1:9000; | |
proxy_redirect off; | |
proxy_buffering off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment