docker-tag: roundcube/roundcubemail:1.6.x-fpm-alpine-nonroot,roundcube/roundcubemail:1.6.10-fpm-alpine-nonroot,roundcube/roundcubemail:latest-fpm-alpine-nonroot
test-tag: roundcube/roundcubemail:latest-fpm-alpine-nonroot
target: 'nonroot'
+ - variant: 'development'
+ test-files: 'development'
+ docker-tag: roundcube/roundcubemail:development
+ test-tag: roundcube/roundcubemail:development
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
--- /dev/null
+FROM docker.io/roundcube/roundcubemail:latest-apache-nonroot
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+USER root
+
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends npm git sudo \
+ && apt-get clean
+
+COPY --chmod=0755 docker-entrypoint.sh /
+
+# Prevent the upstream image from overwriting our code
+RUN rm -r /usr/src/roundcubemail
+
+RUN install -d -o www-data -g www-data /var/roundcube
+
+# Pre-download js dependencies (these don't change much over time).
+ENV CACHEDIR=/var/cache/roundcubemail/jsdeps
+RUN install -o www-data -d "$CACHEDIR"
+
+USER www-data
+
+# We need the code from the repo, not from a released tarball.
+RUN cd /tmp \
+ && curl -OLs https://github.com/roundcube/roundcubemail/archive/refs/heads/master.zip \
+ && unzip -q master.zip \
+ && ./roundcubemail-master/bin/install-jsdeps.sh \
+ && rm -rf master.zip roundcubemail-master
+
+VOLUME /var/www/html
--- /dev/null
+#!/bin/bash -ex
+
+if [[ ! -f index.php ]]; then
+ echo "Error: No source code in /var/www/html – you must mount your code base to that path!"
+ exit 1
+fi
+
+if [[ "$1" != apache2* && "$1" != php-fpm && "$1" != bin* ]]; then
+ exec $@
+fi
+
+# Ensure two very essential requirements are set in the config file.
+if ! grep -q "log_driver.*stdout" config/config.inc.php; then
+ echo "\$config['log_driver'] = 'stdout';" >> config/config.inc.php
+fi
+if ! grep -q "db_dsnw" config/config.inc.php; then
+ echo "\$config['db_dsnw'] = 'sqlite:////var/roundcube/sqlite.db?mode=0644';" >> config/config.inc.php
+fi
+
+# Run the steps necessary to actually use the repository code.
+
+# Install dependencies
+if [[ ! -f composer.json ]]; then
+ # For older versions of Roundcubemail.
+ cp -v composer.json-dist composer.json
+fi
+composer --prefer-dist --no-interaction --optimize-autoloader install
+
+# Download external Javascript dependencies.
+bin/install-jsdeps.sh
+
+# Translate elastic's styles to CSS.
+if grep -q css-elastic Makefile; then
+ make css-elastic
+else
+ # Older versions
+ (
+ npm install less && \
+ npm install less-plugin-clean-css && \
+ cd skins/elastic && \
+ npx lessc --clean-css="--s1 --advanced" styles/styles.less > styles/styles.min.css && \
+ npx lessc --clean-css="--s1 --advanced" styles/print.less > styles/print.min.css && \
+ npx lessc --clean-css="--s1 --advanced" styles/embed.less > styles/embed.min.css \
+ )
+fi
+
+# Update cache-buster parameters in CSS-URLs.
+bin/updatecss.sh
+
+# Initialize or update the database.
+sudo -u www-data bin/initdb.sh --dir=$PWD/SQL --update || echo "Failed to initialize/update the database. Please start with an empty database and restart the container."
+
+exec apache2-foreground