Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreozoux committed Jul 30, 2016
0 parents commit 8fa384b
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 0 deletions.
56 changes: 56 additions & 0 deletions Dockerfile
@@ -0,0 +1,56 @@
FROM php:5.6-fpm

RUN apt-get update && apt-get install -y \
bzip2 \
libcurl4-openssl-dev \
libfreetype6-dev \
libicu-dev \
libjpeg-dev \
libmcrypt-dev \
libmemcached-dev \
libpng12-dev \
libpq-dev \
libxml2-dev \
&& rm -rf /var/lib/apt/lists/*

# https://docs.nextcloud.com/server/9/admin_manual/installation/source_installation.html
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd exif intl mbstring mcrypt mysql opcache pdo_mysql pdo_pgsql pgsql zip

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

# PECL extensions
RUN set -ex \
&& pecl install APCu-4.0.10 \
&& pecl install memcached-2.2.0 \
&& pecl install redis-2.2.8 \
&& docker-php-ext-enable apcu redis memcached

ENV NEXTCLOUD_VERSION 9.0.53
VOLUME /var/www/html

RUN curl -fsSL -o nextcloud.tar.bz2 \
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \
&& curl -fsSL -o nextcloud.tar.bz2.asc \
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
# gpg key from https://nextcloud.com/nextcloud.asc
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A \
&& gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2 \
&& rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc \
&& tar -xjf nextcloud.tar.bz2 -C /usr/src/ \
&& rm nextcloud.tar.bz2

COPY docker-entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
CMD ["php-fpm"]
31 changes: 31 additions & 0 deletions README.md
@@ -0,0 +1,31 @@
What is Nextcloud?

A safe home for all your data. Access & share your files, calendars, contacts, mail & more from any device, on your terms.

![logo](https://github.com/nextcloud/docker/blob/master/logo.png)

# How to use this image

## Start Nextcloud

Starting the Nextcloud 9.0.53 instance listening on port 80 is as easy as the following:

```console
$ docker run -d -p 80:80 nextcloud:9.0.53
```

Then go to http://localhost/ and go through the wizard. By default this container uses SQLite for data storage, but the wizard should allow for connecting to an existing database.

For a MySQL database you can link an database container, e.g. `--link my-mysql:mysql`, and then use `mysql` as the database host on setup.

## Persistent data

All data beyond what lives in the database (file uploads, etc) is stored within the default volume `/var/www/html`. With this volume, Nextcloud will only be updated when the file `version.php` is not present.

- `-v /<mydatalocation>:/var/www/html`

For fine grained data persistence, you can use 3 volumes, as shown below.

- `-v /<mydatalocation>/apps:/var/www/html/apps` installed / modified apps
- `-v /<mydatalocation>/config:/var/www/html/config` local configuration
- `-v /<mydatalocation>/data:/var/www/html/data` the actual data of your Nextcloud
9 changes: 9 additions & 0 deletions docker-entrypoint.sh
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

if [ ! -e '/var/www/html/version.php' ]; then
tar cf - --one-file-system -C /usr/src/nextcloud . | tar xf -
chown -R www-data /var/www/html
fi

exec "$@"
1 change: 1 addition & 0 deletions license.md
@@ -0,0 +1 @@
View [license information](https://github.com/nextcloud/server/blob/master/COPYING-README) for the software contained in this image.
Binary file added logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8fa384b

Please sign in to comment.