diff --git a/README.md b/README.md index 3eac72a44..817ecf4e3 100755 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This repository contains Docker configuration aimed at Moodle developers and tes * All supported database servers (PostgreSQL, MySQL, Micosoft SQL Server, Oracle XE) * Behat/Selenium configuration for Firefox and Chrome * Catch-all smtp server and web interface to messages using [MailHog](https://github.com/mailhog/MailHog/) +* Node container for Javascript compilation * All PHP Extensions enabled configured for external services (e.g. solr, ldap) * All supported PHP versions * Zero-configuration approach diff --git a/base.yml b/base.yml index 24f38820d..956df0912 100755 --- a/base.yml +++ b/base.yml @@ -26,3 +26,9 @@ services: image: "selenium/standalone-firefox${MOODLE_DOCKER_SELENIUM_SUFFIX}:2.53.1" volumes: - "${MOODLE_DOCKER_WWWROOT}:/var/www/html:ro" + node: + build: + context: ./ + dockerfile: node.dockerfile + volumes: + - "${MOODLE_DOCKER_WWWROOT}:/var/www/html diff --git a/bin/start-grunt.sh b/bin/start-grunt.sh new file mode 100755 index 000000000..266f5fc65 --- /dev/null +++ b/bin/start-grunt.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +until cd /var/www/html && npm install +do + echo "Retrying npm install" +done +grunt watch diff --git a/node.dockerfile b/node.dockerfile new file mode 100644 index 000000000..4fcf7b2ee --- /dev/null +++ b/node.dockerfile @@ -0,0 +1,13 @@ +FROM debian:stretch-slim + +RUN apt-get update && apt-get install -my gnupg curl +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - + +RUN apt-get clean +RUN apt-get update +RUN apt-get install -y \ + nodejs + +RUN /usr/bin/npm install -g grunt-cli +ADD ./bin/start-grunt.sh . +CMD ./start-grunt.sh