Based on dnephin answer, I created this sample repo that you can pass an variable to docker-compose up.
The usage is simple:
MAC / LINUX
TEST= docker-compose upto create and start bothappanddbcontainer. The api should then be running on your docker daemon on port 3030.TEST=DO docker-compose upto create and start bothappanddbcontainer. The api should execute thenpm run testinside thepackage.jsonfile.
WINDOWS (Powershell)
$env:TEST="";docker-compose upto create and start bothappanddbcontainer. The api should then be running on your docker daemon on port 3030.$env:TEST="do";docker-compose upto create and start bothappanddbcontainer. The api should execute thenpm run testinside thepackage.jsonfile.