Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
pabzm committed Aug 12, 2024
1 parent e65cac3 commit 550c4fc
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/container-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: roundcubemail-docker-dev image

on:
push:
paths:
- 'Dockerfile'
- 'docker-entrypoint-dev.sh'
- '.github/workflows/container-image.yml'
schedule:
# Rebuild automatically each monday early morning
- cron: "42 3 * * 1"

jobs:
build_and_push:
strategy:
fail-fast: false

name: build and push
runs-on: ubuntu-latest
# Set the permissions granted to the GITHUB_TOKEN for the actions in this job.
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Check actor permission
uses: skjnldsv/check-actor-permission@v2
with:
require: admin
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v2
with:
context: .
push: true
#platforms: linux/amd64,linux/arm64
tags: "ghcr.io/pabzm/roundcubemail-docker-dev:latest"


16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM docker.io/roundcube/roundcubemail

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -y --no-install-recommends npm git \
&& apt-get clean

COPY --chmod=0755 docker-entrypoint-dev.sh /

VOLUME /var/www/html

ENTRYPOINT ["/docker-entrypoint-dev.sh"]

# This CMD is from the upstream image, don't know why it needs to be repeated.
CMD ["apache2-foreground"]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Roundcubemail Docker Dev
========================

A container image to easily run Roundcubemail from its repository code.

This image expects to be run with Roundcubemail's repository code mounted to `/var/www/html`, and prepares it to be runnable.
24 changes: 24 additions & 0 deletions docker-entrypoint-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -ex

if [[ -f /var/www/html/index.php ]]; then
# Run the steps necessary to actually use the repository code.
cd /var/www/html
# This first command is also in the upstream entrypoint-script, but it needs to run before the PHP-scripts do, so we also need it here.
composer --prefer-dist --no-dev --no-interaction --optimize-autoloader install
# Download external Javascript dependencies.
bin/install-jsdeps.sh
# Minify all JS files
bin/jsshrink.sh
# Translate elastic's styles to 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
cd -
# Update cache-buster parameters in CSS-URLs.
bin/updatecss.sh
# Minify all CSS files.
bin/cssshrink.sh
fi

exec /docker-entrypoint.sh "$@"

0 comments on commit 550c4fc

Please sign in to comment.