From a48e84bf089b87f35f5b8099807074f65e40d949 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Thu, 8 Sep 2022 15:35:40 -0400 Subject: [PATCH] Add node service to docker compose with run script --- src/docker-compose.yml | 9 +++++++++ src/run_node_watch.sh | 15 +++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 src/run_node_watch.sh diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 2830e628a..8d1d2a728 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -38,3 +38,12 @@ services: - POSTGRES_DB=app - POSTGRES_USER=user - POSTGRES_PASSWORD=feedabee + + node: + image: node + volumes: + - .:/app + working_dir: /app + stdin_open: true + tty: true + command: ./run_node_watch.sh diff --git a/src/run_node_watch.sh b/src/run_node_watch.sh new file mode 100755 index 000000000..b793f229c --- /dev/null +++ b/src/run_node_watch.sh @@ -0,0 +1,15 @@ +#!/bin/bash +npm install +npm rebuild +dir=./registrar/assets +if [ -d "$dir" ] +then + echo "Compiling USWDS assets" + npx gulp copyAssets + npx gulp compile +else + echo "Initial USWDS assets build" + npx gulp init + npx gulp compile +fi +npx gulp watch