Skip to content

Commit

Permalink
Add docker-compose service to test, build, deploy Javascript components
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Rija Menage authored and rija committed Sep 6, 2020
1 parent 89d7253 commit 2f5ae8d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ops/deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2f5ae8d

Please sign in to comment.