diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..06a817ad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM php:7.0-apache +MAINTAINER Ian Droogmans + +# Install base packages +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get -yq install \ + rubygems \ + && \ + gem install sass + +# Add entrypoint +ADD docker-entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..a5dba66a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '2' +services: + php: + build: . + ports: + - "8002:80" + environment: + CSSCOMPILER: "SASS" + volumes: + - .:/var/www/html + entrypoint: "/entrypoint.sh" + command: "apache2-foreground" diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 00000000..4de9b76a --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -e +echo "Start of entrypoint" +if [ "$1" = 'apache2-foreground' ]; then + echo "starting compiler checks" + if [ "$CSSCOMPILER" = "SASS" ]; then + echo "Starting SASS compiler." + nohup sass --watch scss/:css/ > ${logDir}/$(/bin/date +%Y%m%d.%H%M).sass_watch.log 2>&1 & + fi +fi +echo "End of entrypoint" + +exec "$@"