Add node service to docker compose with run script

This commit is contained in:
igorkorenfeld 2022-09-08 15:35:40 -04:00
parent 9684e9ffe2
commit a48e84bf08
No known key found for this signature in database
GPG key ID: 826947A4B867F659
2 changed files with 24 additions and 0 deletions

View file

@ -38,3 +38,12 @@ services:
- POSTGRES_DB=app - POSTGRES_DB=app
- POSTGRES_USER=user - POSTGRES_USER=user
- POSTGRES_PASSWORD=feedabee - POSTGRES_PASSWORD=feedabee
node:
image: node
volumes:
- .:/app
working_dir: /app
stdin_open: true
tty: true
command: ./run_node_watch.sh

15
src/run_node_watch.sh Executable file
View file

@ -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