:memo: How to extend image with composer & fix #40
authormathieu.brunot <redacted>
Sat, 1 Jun 2019 18:24:07 +0000 (20:24 +0200)
committermathieu.brunot <redacted>
Sat, 1 Jun 2019 18:24:07 +0000 (20:24 +0200)
README.md

index f4a07116bf1314657352c76c46ddd241c5256fb2..e5206616dce41605750d4f00e5144742868e0879 100644 (file)
--- a/README.md
+++ b/README.md
@@ -81,3 +81,35 @@ Build it from this directory with
 ```
 docker build -t roundcubemail .
 ```
+
+You can also create your own Docker image by extending from this image.
+
+For instance, you could extend this image to add composer and install requirements for builtin plugins or even external plugins:
+```Dockerfile
+FROM roundcube/roundcubemail:latest
+
+RUN set -ex; \
+    apt-get update; \
+    apt-get install -y --no-install-recommends \
+        git \
+    ; \
+    \
+    curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer; \
+    mv /usr/src/roundcubemail/composer.json-dist /usr/src/roundcubemail/composer.json; \
+    \
+    composer \
+        --working-dir=/usr/src/roundcubemail/ \
+        --prefer-dist --prefer-stable \
+        --no-update --no-interaction \
+        --optimize-autoloader --apcu-autoloader \
+        require \
+            johndoh/contextmenu \
+    ; \
+    composer \
+        --working-dir=/usr/src/roundcubemail/ \
+        --prefer-dist --no-dev \
+        --no-interaction \
+        --optimize-autoloader --apcu-autoloader \
+        update;
+
+```
git clone https://git.99rst.org/PROJECT