Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

408
Views
docker-compose does not override a command using the start command

I have a docker-compose override file to use for running tests on containers. I want to start my node server with a different command - nyc node server.js. I have a docker-compose.coverage.yml file that overrides the normal compose file like so:

node:
    command: nyc node server.js

However, it never seems to override the command when I do docker-compose -f docker-compose.yml -f docker-compose.coverage.yml start node. When I use docker-compose run it overrides the command, but the service exits. Does anyone know why it wouldn't be overriding the command using start?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

docker-compose start will start an existing, stopped container. An existing container will already have the command baked in, and you can't change it.

What you want to do is use docker-compose up. This will look for changes to docker-compose.yml, and if there's anything to change, it will recreate the container with the new options, then start or restart it.

So you want something like this:

docker-compose -f docker-compose.yml -f docker-compose.coverage.yml up -d node
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!