Skip to content

Commit

Permalink
rename config, add basic config.php, load richdocuments from appstore
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Böhm committed Jul 13, 2016
1 parent 1d7165c commit 0c05ecc
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 24 deletions.
37 changes: 21 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,43 @@ RUN apt-get update -y && apt-get upgrade -y && apt-get install -y \
smbclient \
mysql-client

# apache modules oc needs as documented
RUN a2enmod rewrite
RUN a2enmod headers
RUN a2enmod env
RUN a2enmod dir
RUN a2enmod mime
RUN a2enmod ssl
RUN a2ensite default-ssl

# Upload of big files
RUN sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 20G|' /etc/php/7.0/apache2/php.ini
RUN sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 20G|' /etc/php/7.0/cli/php.ini
RUN sed -i 's|post_max_size = 8M|post_max_size = 20G|' /etc/php/7.0/apache2/php.ini
RUN sed -i 's|post_max_size = 8M|post_max_size = 20G|' /etc/php/7.0/cli/php.ini

# download ownCloud
ARG OWNCLOUD_TARBALL=https://download.owncloud.org/community/owncloud-9.0.3.tar.bz2
RUN curl -sLo - ${OWNCLOUD_TARBALL} | tar xfj - -C /var/www/

ADD src/richdocuments.zip /var/www/owncloud/apps/
# download richdocuments app
RUN wget https://apps.owncloud.com/CONTENT/content-files/174727-richdocuments.zip -O /var/www/owncloud/apps/richdocuments.zip
RUN unzip -q /var/www/owncloud/apps/richdocuments.zip -d /var/www/owncloud/apps/

# create data folder
RUN mkdir -p /mnt/data
ADD conf/config.php /var/www/owncloud/config/config.php

RUN chsh -s /bin/bash www-data
RUN chown -R www-data.www-data /mnt/data
RUN chown -R www-data.www-data /var/www/owncloud

# apache modules oc needs as documented
RUN a2enmod rewrite
RUN a2enmod headers
RUN a2enmod env
RUN a2enmod dir
RUN a2enmod mime
RUN a2enmod ssl
RUN a2ensite default-ssl

# Apache configs
RUN sed -i 's_DocumentRoot /var/www/html_DocumentRoot /var/www/owncloud_' /etc/apache2/sites-enabled/000-default.conf
RUN sed -i 's_DocumentRoot /var/www/html_DocumentRoot /var/www/owncloud_' /etc/apache2/sites-enabled/default-ssl.conf
RUN sed -i 's|</VirtualHost>|\t<IfModule mod_headers.c>\n\t\t\tHeader always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"\n\t\t</IfModule>\n\t</VirtualHost>|' /etc/apache2/sites-enabled/default-ssl.conf
RUN sed -i 's|unset HOME|unset HOME\nexport HOME=/var/www|' /etc/apache2/envvars

# Upload of big files
RUN sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 20G|' /etc/php/7.0/apache2/php.ini
RUN sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 20G|' /etc/php/7.0/cli/php.ini
RUN sed -i 's|post_max_size = 8M|post_max_size = 20G|' /etc/php/7.0/apache2/php.ini
RUN sed -i 's|post_max_size = 8M|post_max_size = 20G|' /etc/php/7.0/cli/php.ini

# Provide scripts in /usr/local/bin
ADD bin src/bin
RUN chmod 0755 src/bin/*
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ docker-compose up -d
Install ownCloud

```bash
docker-compose exec owncloud container-config.sh
docker-compose exec owncloud owncloud-config.sh
```

### Manual startup
Expand All @@ -42,17 +42,16 @@ docker run -d -ti \
For automatic installation run:

```bash
docker exec -ti owncloud container-config.sh
docker exec -ti owncloud owncloud-config.sh
```

Access ownCloud:
### Access ownCloud

```
https://localhost/
user: admin
pw: password
(as set in bin/container-config.sh)
```

- user: admin
- pass: password (as set in bin/container-config.sh)


## Versions

Expand Down
1 change: 1 addition & 0 deletions bin/container-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
# Start apache
service apache2 start

touch /mnt/data/owncloud.log
tail -F /mnt/data/owncloud.log
File renamed without changes.
5 changes: 5 additions & 0 deletions conf/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
$CONFIG = array (
'datadirectory' => '/mnt/data',
'logfile' => '/mnt/data/owncloud.log',
);
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
environment:
- REDIS_OPTS=--protected-mode no
owncloud:
build: .
image: "owncloud/server:${VERSION}"
ports:
- "443:443"
Expand Down
Binary file removed src/richdocuments.zip
Binary file not shown.

0 comments on commit 0c05ecc

Please sign in to comment.