Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add node container support #89

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- "${MOODLE_DOCKER_WWWROOT}:/var/www/html
- "${MOODLE_DOCKER_WWWROOT}:/var/www/html"

7 changes: 7 additions & 0 deletions bin/start-grunt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

until cd /var/www/html && npm install
do
echo "Retrying npm install"
done
grunt watch
13 changes: 13 additions & 0 deletions node.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM debian:stretch-slim

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use FROM node? Also there is already a discussion about including node in the moodle-apache-php image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FROM debian:stretch-slim
FROM node


RUN apt-get update && apt-get install -my gnupg curl
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
Copy link

@odeialba odeialba Jul 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_14.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 .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ADD ./bin/start-grunt.sh .
ADD ./bin/start-grunt.sh .
USER root
RUN chmod 755 ./start-grunt.sh

CMD ./start-grunt.sh