Browse Source

Initial import

commit
5bb3e13a10
4 changed files with 96 additions and 0 deletions
  1. 8
    0
      .drone.yml
  2. 22
    0
      Dockerfile
  3. 24
    0
      README.md
  4. 42
    0
      docker-entrypoint.sh

+ 8
- 0
.drone.yml View File

@@ -0,0 +1,8 @@
1
+pipeline:
2
+  publish:
3
+    image: plugins/docker
4
+    repo: r3pek/roundcube
5
+    secrets: [ docker_username, docker_password ]
6
+    when:
7
+      branch: master
8
+      event: push

+ 22
- 0
Dockerfile View File

@@ -0,0 +1,22 @@
1
+FROM instrumentisto/roundcube
2
+
3
+COPY docker-entrypoint.sh /docker-entrypoint.sh
4
+
5
+RUN apt-get update \
6
+ && apt-get upgrade -y \
7
+ && apt-get install -y --no-install-recommends --no-install-suggests \
8
+    git \
9
+    gnupg \
10
+    libxml2-dev \
11
+ && docker-php-ext-configure soap --with-libdir=lib/x86_64-linux-gnu \
12
+ && docker-php-ext-install soap \
13
+ && curl -fL -o /tmp/composer-setup.php https://getcomposer.org/installer \
14
+ && curl -fL -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
15
+ && php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { echo 'Invalid installer' . PHP_EOL; exit(1); }" \
16
+ && php /tmp/composer-setup.php --install-dir=/tmp --filename=composer \
17
+ && chmod +x /docker-entrypoint.sh \
18
+ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false libxml2-dev \
19
+ && rm -rf /var/lib/apt/lists/* \
20
+ && mkdir /plugins_config
21
+
22
+VOLUME ["plugins_config"]

+ 24
- 0
README.md View File

@@ -0,0 +1,24 @@
1
+# Roundcube Image
2
+
3
+![ ](https://drone.r3pek.org/api/badges/r3pek/docker-roundcube/status.svg  "Build Status") ![ ](https://img.shields.io/docker/pulls/r3pek/roundcube.svg  "Docker Pulls") ![ ](https://img.shields.io/docker/stars/r3pek/roundcube.svg  "Docker Stars")
4
+
5
+This image is derived from the [Instrumentisto Roundcube Image](https://hub.docker.com/r/instrumentisto/roundcube/) 
6
+
7
+It works in everything like the parent image, being the main difference that you can add plugins to be installed at boot time in the file */app/composer.json*.
8
+Basically, what I do, is to create a *Docker Config* with the composer.json content and mount it on the unformentioned directory. Something like this:
9
+
10
+	configs:
11
+	    - source: composer
12
+	      target: /app/composer.json
13
+
14
+This way, you can install the plugins you want for your Roundcube instalation. Don't forget to also mount the config files if the plugins you install need them.
15
+
16
+# Quick Reference
17
+* Where to file issues / suggestions
18
+https://code.r3pek.org/r3pek/docker-roundcube/issues
19
+
20
+* Maintained by
21
+[r3pek](https://code.r3pek.org/r3pek/)
22
+
23
+* Source repository
24
+https://code.r3pek.org/r3pek/docker-roundcube/

+ 42
- 0
docker-entrypoint.sh View File

@@ -0,0 +1,42 @@
1
+#!/bin/bash
2
+
3
+
4
+logMsg() {
5
+  echo "["`date +%d'-'%b'-'%Y' '%H':'%M':'%S`"] $1" >> /proc/self/fd/2
6
+}
7
+
8
+
9
+rm -f /usr/local/etc/php/conf.d/zz-opcache-revalidation.ini
10
+if [ "$PHP_OPCACHE_REVALIDATION" == "1" ]; then
11
+  echo "opcache.validate_timestamps = On" \
12
+    > /usr/local/etc/php/conf.d/zz-opcache-revalidation.ini
13
+  logMsg "STARTUP: PHP OPcache revalidation is enabled"
14
+fi
15
+
16
+
17
+appDir=/app
18
+if [ "$SHARE_APP" == "1" ]; then
19
+  mkdir -p /shared
20
+  cp -rf /app/* /app/.htaccess /shared/
21
+  chown -R www-data:www-data /shared/* /shared/.htaccess
22
+  appDir=/shared
23
+fi
24
+rm -f /var/www
25
+ln -s $appDir /var/www
26
+chown -R www-data:www-data /var/www
27
+
28
+cd /app
29
+/tmp/composer update --no-dev --optimize-autoloader --no-progress
30
+/tmp/composer install --no-dev --optimize-autoloader --no-progress
31
+cd ..
32
+
33
+# Copy the plugins' configs to the correct place
34
+for i in `find /plugins_config/* -type f`; do 
35
+  dir=$(dirname $i) 
36
+  dir=${dir##*/}
37
+  file=${i##*/}
38
+  rm "/app/plugins/${dir}/${file}"
39
+  ln -s "/plugins_config/${dir}/${file}" "/app/plugins/${dir}/${file}"
40
+done
41
+
42
+exec "$@"

Loading…
Cancel
Save