From 2f5ae8dbf8867b081aeb746cd4f6151778243530 Mon Sep 17 00:00:00 2001 From: Rija Menage Date: Mon, 30 Dec 2019 18:23:37 +0800 Subject: [PATCH] Add docker-compose service to test, build, deploy Javascript components Using the new custom Dockerfile for NodeJS ecosystem and headless web browser, the new service's default command will run the test, build and deploy scripts specified in the package.json project configuration file of the Javascript components codebase. The command will be run from the WORKDIR value set in the Dockerfile which is /var/www/gigadb/app/client/web, so we need to bind-mount the application directory to /var/www, so that the Javascript codebase can be found. Containers that run desktop web browsers need to have the shared memory setting (shm_size) configured otherwise they'll throw errors. The Container image run Debian Buster, so it's possible to use bash for running commands and for opening a debugging terminal --- ops/deployment/docker-compose.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ops/deployment/docker-compose.yml b/ops/deployment/docker-compose.yml index 48ae789fa9..e3fb93c3d6 100644 --- a/ops/deployment/docker-compose.yml +++ b/ops/deployment/docker-compose.yml @@ -215,6 +215,15 @@ services: - "fuw-admin-api:172.16.238.10" command: bash -c "./tests/all_and_coverage" + js: + build: + context: . + dockerfile: ../packaging/VueDev-Dockerfile + volumes: + - ${APPLICATION}/:/var/www + shm_size: '1gb' # to avoid a known issue + command: bash -c "npm test ; npm run build ; npm run deploy" + phantomjs: image: wernight/phantomjs:2.1.1 command: phantomjs --webdriver=8910