From ab70eecc0b91df132b0508d9219dcab65c665841 Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Wed, 29 Aug 2018 06:42:16 +0300 Subject: [PATCH] Avoid using NPM in scripts NPM creates an extra layer of processes in containers which [do not properly forward signals](https://github.com/npm/npm/issues/4603). This can cause problems starting/stopping containers quickly. Additionally NPM tries to write to the filesystem as part of its self-update check. We would like to move to read only root container filesystems (using `read_only: true` in docker-compose.yml), so the easiest way to work around this NPM "feature" is to avoid using NPM. --- cmd/elastic.sh | 2 +- cmd/prepare.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/elastic.sh b/cmd/elastic.sh index eb22d47..1828da3 100644 --- a/cmd/elastic.sh +++ b/cmd/elastic.sh @@ -2,7 +2,7 @@ set -e; function elastic_schema_drop(){ compose_run 'schema' node scripts/drop_index "$@" || true; } -function elastic_schema_create(){ compose_run 'schema' npm run create_index; } +function elastic_schema_create(){ compose_run 'schema' node scripts/create_index; } function elastic_start(){ compose_exec up -d elasticsearch; } function elastic_stop(){ compose_exec kill elasticsearch; } diff --git a/cmd/prepare.sh b/cmd/prepare.sh index 768bbc3..5ac490e 100644 --- a/cmd/prepare.sh +++ b/cmd/prepare.sh @@ -5,8 +5,8 @@ set -e; function prepare_polylines(){ compose_run 'polylines' bash ./docker_extract.sh; } function prepare_interpolation(){ compose_run 'interpolation' bash ./docker_build.sh; } function prepare_placeholder(){ - compose_run 'placeholder' npm run extract - compose_run 'placeholder' npm run build + compose_run 'placeholder' ./cmd/extract.sh; + compose_run 'placeholder' ./cmd/build.sh; } register 'prepare' 'polylines' 'export road network from openstreetmap into polylines format' prepare_polylines