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 up
to create and start bothapp
anddb
container. The api should then be running on your docker daemon on port 3030.TEST=DO docker-compose up
to create and start bothapp
anddb
container. The api should execute thenpm run test
inside thepackage.json
file.
WINDOWS (Powershell)
$env:TEST="";docker-compose up
to create and start bothapp
anddb
container. The api should then be running on your docker daemon on port 3030.$env:TEST="do";docker-compose up
to create and start bothapp
anddb
container. The api should execute thenpm run test
inside thepackage.json
file.