Remove volume declarations (#142)
authorThomas Bruederli <redacted>
Mon, 13 Jun 2022 20:54:14 +0000 (22:54 +0200)
committerThomas Bruederli <redacted>
Mon, 13 Jun 2022 20:54:14 +0000 (22:54 +0200)
... and document recommended mount mounts in README

README.md
apache/Dockerfile
fpm-alpine/Dockerfile
fpm/Dockerfile
templates/Dockerfile-alpine.templ
templates/Dockerfile-debian.templ

index 4265cdbea2bf662208a76f66cf8108b66aba33fc..5c4c3ff6bd551ea321bc4ac3db7701aaee3b3a75 100644 (file)
--- a/README.md
+++ b/README.md
@@ -43,7 +43,7 @@ The following env variables can be set to configure your Roundcube Docker instan
 `ROUNDCUBEMAIL_ASPELL_DICTS` - List of aspell dictionaries to install for spell checking (comma-separated, e.g. `de,fr,pl`). 
 
 By default, the image will use a local SQLite database for storing user account metadata.
-It'll be created inside the `/var/roundcube/db` directory and can be backed up from there. Please note that
+It'll be created inside the unnamed volume `/var/roundcube/db` and can be backed up from there. Please note that
 this option should not be used for production environments.
 
 ### Connect to a Database
@@ -71,6 +71,26 @@ Run it with a link to the MySQL host and the username/password variables:
 docker run --link=mysql:mysql -d roundcube/roundcubemail
 ```
 
+## Persistent data
+
+The Roundcube containers do not store any data persistently by default. There are, however,
+some directories that could be mounted as volume or bind mount to share data between containers
+or to inject additional data into the container:
+
+* `/var/www/html`: Roundcube installation directory  
+  This is the document root of Roundcube. Plugins and additional skins are stored here amongst the Roundcube sources.
+  Share this directory when using the FPM variant and let a webserver container serve the static files from here.
+
+* `/var/roundcube/config`: Location for additonal config files  
+  See the [Advanced configuration](#advanced-configuration) section for details.
+
+* `/var/roundcube/db`: storage location of the SQLite database  
+  Only needed if using `ROUNDCUBEMAIL_DB_TYPE=sqlite` to persist the Roundcube database.
+
+* `/tmp/roundcube-temp`: Roundcube's temp folder  
+  Temp files like uploaded attachments or thumbnail images are stored here.
+  Share this directory via a volume when running multiple replicas of the roundcube container.
+
 ## Docker Secrets
 
 When running the Roundcube container in a Docker Swarm, you can use [Docker Secrets](https://docs.docker.com/engine/swarm/secrets/)
@@ -83,7 +103,7 @@ to share credentials accross all instances. The following secrets are currently
 ## Advanced configuration
 
 Apart from the above described environment variables, the Docker image also allows to add custom config files
-which are merged into Roundcube's default config. Therefore the image defines a volume `/var/roundcube/config`
+which are merged into Roundcube's default config. Therefore the image defines the path `/var/roundcube/config`
 where additional config files (`*.php`) are searched and included. Mount a local directory with your config
 files - check for valid PHP syntax - when starting the Docker container:
 
@@ -106,7 +126,8 @@ inside a running Roundcube container:
 $ docker exec -it roundcubemail composer require johndoh/contextmenu --update-no-dev
 ```
 
-If you have mounted the container's volume `/var/www/html` the plugins installed persist on your host system. Otherwise they need to be (re-)installed every time you update or restart the Roundcube container.
+If you have mounted the container's volume `/var/www/html` the plugins installed persist on your host system.
+Otherwise they need to be (re-)installed every time you update or restart the Roundcube container.
 
 ## Examples
 
@@ -115,7 +136,7 @@ A few example setups using `docker-compose` can be found in our [Github reposito
 ## Building a Docker image
 
 Use the `Dockerfile` in this repository to build your own Docker image.
-It pulls the latest build of Roundcube Webmail from the Github download page and builds it on top of a `php:7.3-apache` Docker image.
+It pulls the latest build of Roundcube Webmail from the Github download page and builds it on top of a `php:7.4-apache` Docker image.
 
 Build it from one of the variants directories with
 
index 10e7f2116891cae1a98848c9fb7be10a36e24a97..9676f4cdf11d9b6983a28640c0160d20e59f2072 100644 (file)
@@ -67,12 +67,6 @@ COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
 
 RUN a2enmod rewrite
 
-# expose these volumes
-VOLUME /var/roundcube/config
-VOLUME /var/roundcube/db
-VOLUME /var/www/html
-VOLUME /tmp/roundcube-temp
-
 # Define Roundcubemail version
 ENV ROUNDCUBEMAIL_VERSION 1.5.2
 
@@ -113,5 +107,7 @@ COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
 
 COPY --chmod=0755 docker-entrypoint.sh /
 
+RUN mkdir -p /var/roundcube/config
+
 ENTRYPOINT ["/docker-entrypoint.sh"]
 CMD ["apache2-foreground"]
index 2213669bfb63b26cce312497977c527b0ee24254..fb190ca502eaaffb204b1a842447c6fc9c683f86 100644 (file)
@@ -58,10 +58,7 @@ COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
 
 
 # expose these volumes
-VOLUME /var/roundcube/config
 VOLUME /var/roundcube/db
-VOLUME /var/www/html
-VOLUME /tmp/roundcube-temp
 
 # Define Roundcubemail version
 ENV ROUNDCUBEMAIL_VERSION 1.5.2
@@ -105,5 +102,7 @@ COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
 
 COPY --chmod=0755 docker-entrypoint.sh /
 
+RUN mkdir -p /var/roundcube/config
+
 ENTRYPOINT ["/docker-entrypoint.sh"]
 CMD ["php-fpm"]
index 2c7f25e0d66d60fb38edbd72d69ccbdfcb35eb2f..23ed6bf0cdd58cc43c10cc875ccd07cd78039922 100644 (file)
@@ -66,12 +66,6 @@ RUN set -ex; \
 COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
 
 
-# expose these volumes
-VOLUME /var/roundcube/config
-VOLUME /var/roundcube/db
-VOLUME /var/www/html
-VOLUME /tmp/roundcube-temp
-
 # Define Roundcubemail version
 ENV ROUNDCUBEMAIL_VERSION 1.5.2
 
@@ -112,5 +106,7 @@ COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
 
 COPY --chmod=0755 docker-entrypoint.sh /
 
+RUN mkdir -p /var/roundcube/config
+
 ENTRYPOINT ["/docker-entrypoint.sh"]
 CMD ["php-fpm"]
index 151eba160c1e989f926107f08f479290a601ccba..7ec5d2e0f57b9cc40f214f0020d3189ab2d38d63 100644 (file)
@@ -58,10 +58,7 @@ COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
 %%EXTRAS%%
 
 # expose these volumes
-VOLUME /var/roundcube/config
 VOLUME /var/roundcube/db
-VOLUME /var/www/html
-VOLUME /tmp/roundcube-temp
 
 # Define Roundcubemail version
 ENV ROUNDCUBEMAIL_VERSION %%VERSION%%
@@ -105,5 +102,7 @@ COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
 
 COPY --chmod=0755 docker-entrypoint.sh /
 
+RUN mkdir -p /var/roundcube/config
+
 ENTRYPOINT ["/docker-entrypoint.sh"]
 CMD ["%%CMD%%"]
index 02f12a8ac867bccf7c1ce0aa98f4e8c087d13322..6b4dc04e2c798a6727570325a36298663c54b4bc 100644 (file)
@@ -66,12 +66,6 @@ RUN set -ex; \
 COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
 %%EXTRAS%%
 
-# expose these volumes
-VOLUME /var/roundcube/config
-VOLUME /var/roundcube/db
-VOLUME /var/www/html
-VOLUME /tmp/roundcube-temp
-
 # Define Roundcubemail version
 ENV ROUNDCUBEMAIL_VERSION %%VERSION%%
 
@@ -112,5 +106,7 @@ COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
 
 COPY --chmod=0755 docker-entrypoint.sh /
 
+RUN mkdir -p /var/roundcube/config
+
 ENTRYPOINT ["/docker-entrypoint.sh"]
 CMD ["%%CMD%%"]
git clone https://git.99rst.org/PROJECT