Browse Source

Initial import

master
Carlos Mogas da Silva 2 years ago
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 @@
pipeline:
publish:
image: plugins/docker
repo: r3pek/roundcube
secrets: [ docker_username, docker_password ]
when:
branch: master
event: push

+ 22
- 0
Dockerfile View File

@ -0,0 +1,22 @@
FROM instrumentisto/roundcube
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends --no-install-suggests \
git \
gnupg \
libxml2-dev \
&& docker-php-ext-configure soap --with-libdir=lib/x86_64-linux-gnu \
&& docker-php-ext-install soap \
&& curl -fL -o /tmp/composer-setup.php https://getcomposer.org/installer \
&& curl -fL -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
&& 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); }" \
&& php /tmp/composer-setup.php --install-dir=/tmp --filename=composer \
&& chmod +x /docker-entrypoint.sh \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false libxml2-dev \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /plugins_config
VOLUME ["plugins_config"]

+ 24
- 0
README.md View File

@ -0,0 +1,24 @@
# Roundcube Image
![ ](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")
This image is derived from the [Instrumentisto Roundcube Image](https://hub.docker.com/r/instrumentisto/roundcube/)
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*.
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:
configs:
- source: composer
target: /app/composer.json
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.
# Quick Reference
* Where to file issues / suggestions
https://code.r3pek.org/r3pek/docker-roundcube/issues
* Maintained by
[r3pek](https://code.r3pek.org/r3pek/)
* Source repository
https://code.r3pek.org/r3pek/docker-roundcube/

+ 42
- 0
docker-entrypoint.sh View File

@ -0,0 +1,42 @@
#!/bin/bash
logMsg() {
echo "["`date +%d'-'%b'-'%Y' '%H':'%M':'%S`"] $1" >> /proc/self/fd/2
}
rm -f /usr/local/etc/php/conf.d/zz-opcache-revalidation.ini
if [ "$PHP_OPCACHE_REVALIDATION" == "1" ]; then
echo "opcache.validate_timestamps = On" \
> /usr/local/etc/php/conf.d/zz-opcache-revalidation.ini
logMsg "STARTUP: PHP OPcache revalidation is enabled"
fi
appDir=/app
if [ "$SHARE_APP" == "1" ]; then
mkdir -p /shared
cp -rf /app/* /app/.htaccess /shared/
chown -R www-data:www-data /shared/* /shared/.htaccess
appDir=/shared
fi
rm -f /var/www
ln -s $appDir /var/www
chown -R www-data:www-data /var/www
cd /app
/tmp/composer update --no-dev --optimize-autoloader --no-progress
/tmp/composer install --no-dev --optimize-autoloader --no-progress
cd ..
# Copy the plugins' configs to the correct place
for i in `find /plugins_config/* -type f`; do
dir=$(dirname $i)
dir=${dir##*/}
file=${i##*/}
rm "/app/plugins/${dir}/${file}"
ln -s "/plugins_config/${dir}/${file}" "/app/plugins/${dir}/${file}"
done
exec "$@"

Loading…
Cancel
Save