How do I pass an argument along with docker-compose up?

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 both app and db container. The api should then be running on your docker daemon on port 3030.
  • TEST=DO docker-compose up to create and start both app and db container. The api should execute the npm run test inside the package.json file.

WINDOWS (Powershell)

  • $env:TEST="";docker-compose up to create and start both app and db container. The api should then be running on your docker daemon on port 3030.
  • $env:TEST="do";docker-compose up to create and start both app and db container. The api should execute the npm run test inside the package.json file.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)