0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-04-19 18:36:09 +02:00

Dockerfile: use correct VOLUMEs

The persistent data is just the contents of config/ (configuration),
apps/ (installed apps), and data/ (user data). The source code should
not be made into a volume because it will cause persistence issues when
you try to update an image.

Currently the existing setup means that standard Docker-style updates
(where you start a new Docker image) won't actually update the source
code -- causing confusion and other issues.

This matches how ownCloud's setup works as well.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This commit is contained in:
Aleksa Sarai 2017-01-25 01:59:28 +11:00
parent 4f8fa003c9
commit 4eacdfd848
No known key found for this signature in database
GPG key ID: 4A7BE7BF70DE9B9F
8 changed files with 9 additions and 13 deletions

View file

@ -40,7 +40,7 @@ RUN set -ex \
RUN a2enmod rewrite RUN a2enmod rewrite
ENV NEXTCLOUD_VERSION 10.0.3 ENV NEXTCLOUD_VERSION 10.0.3
VOLUME /var/www/html VOLUME ["/var/www/html/data", "/var/www/html/config", "/var/www/html/apps"]
RUN curl -fsSL -o nextcloud.tar.bz2 \ RUN curl -fsSL -o nextcloud.tar.bz2 \
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \

View file

@ -38,7 +38,7 @@ RUN set -ex \
&& docker-php-ext-enable apcu redis memcached && docker-php-ext-enable apcu redis memcached
ENV NEXTCLOUD_VERSION 10.0.3 ENV NEXTCLOUD_VERSION 10.0.3
VOLUME /var/www/html VOLUME ["/var/www/html/data", "/var/www/html/config", "/var/www/html/apps"]
RUN curl -fsSL -o nextcloud.tar.bz2 \ RUN curl -fsSL -o nextcloud.tar.bz2 \
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \

View file

@ -40,7 +40,7 @@ RUN set -ex \
RUN a2enmod rewrite RUN a2enmod rewrite
ENV NEXTCLOUD_VERSION 11.0.1 ENV NEXTCLOUD_VERSION 11.0.1
VOLUME /var/www/html VOLUME ["/var/www/html/data", "/var/www/html/config", "/var/www/html/apps"]
RUN curl -fsSL -o nextcloud.tar.bz2 \ RUN curl -fsSL -o nextcloud.tar.bz2 \
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \

View file

@ -38,7 +38,7 @@ RUN set -ex \
&& docker-php-ext-enable apcu redis memcached && docker-php-ext-enable apcu redis memcached
ENV NEXTCLOUD_VERSION 11.0.1 ENV NEXTCLOUD_VERSION 11.0.1
VOLUME /var/www/html VOLUME ["/var/www/html/data", "/var/www/html/config", "/var/www/html/apps"]
RUN curl -fsSL -o nextcloud.tar.bz2 \ RUN curl -fsSL -o nextcloud.tar.bz2 \
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \

View file

@ -40,7 +40,7 @@ RUN set -ex \
RUN a2enmod rewrite RUN a2enmod rewrite
ENV NEXTCLOUD_VERSION 9.0.56 ENV NEXTCLOUD_VERSION 9.0.56
VOLUME /var/www/html VOLUME ["/var/www/html/data", "/var/www/html/config", "/var/www/html/apps"]
RUN curl -fsSL -o nextcloud.tar.bz2 \ RUN curl -fsSL -o nextcloud.tar.bz2 \
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \

View file

@ -38,7 +38,7 @@ RUN set -ex \
&& docker-php-ext-enable apcu redis memcached && docker-php-ext-enable apcu redis memcached
ENV NEXTCLOUD_VERSION 9.0.56 ENV NEXTCLOUD_VERSION 9.0.56
VOLUME /var/www/html VOLUME ["/var/www/html/data", "/var/www/html/config", "/var/www/html/apps"]
RUN curl -fsSL -o nextcloud.tar.bz2 \ RUN curl -fsSL -o nextcloud.tar.bz2 \
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \

View file

@ -40,7 +40,7 @@ RUN set -ex \
RUN a2enmod rewrite RUN a2enmod rewrite
ENV NEXTCLOUD_VERSION %%VERSION%% ENV NEXTCLOUD_VERSION %%VERSION%%
VOLUME /var/www/html VOLUME ["/var/www/html/data", "/var/www/html/config", "/var/www/html/apps"]
RUN curl -fsSL -o nextcloud.tar.bz2 \ RUN curl -fsSL -o nextcloud.tar.bz2 \
"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \

View file

@ -21,11 +21,7 @@ By default this container uses SQLite for data storage, but the Nextcloud setup
## Persistent data ## Persistent data
All data beyond that which 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. All data beyond that which lives in the database (file uploads, etc) is stored within several volumes, which are all separately controlled (to ensure that the source code of NextCloud can be updated by switching Docker versions -- please always follow the correct upgrade process despite the ease of just switching images):
- `-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>/apps:/var/www/html/apps` installed / modified apps
- `-v /<mydatalocation>/config:/var/www/html/config` local configuration - `-v /<mydatalocation>/config:/var/www/html/config` local configuration