Docker custom run params on compose file

Viewed 54

I need to run a docker container using this command

docker run --rm -it -p 5000:5000 --memory 4g --cpus 4 \
mcr.microsoft.com/azure-cognitive-services/speechservices/speech-to-text \
Eula=accept \
Billing={ENDPOINT_URI} \
ApiKey={API_KEY}

But I need to run it via a docker compose file, and can't manage to set the parameters Eula, Billing and ApiKey. Any hints on how that could be achieved?

1 Answers

I managed to make it work with @Zeitounator suggestion

The docker compose file end looking like this:

version: '3'
services:
  scriptme-ml-model:
    image: mcr.microsoft.com/azure-cognitive-services/speechservices/speech-to-text
    ports:
      - 5000:5000
    deploy:
        resources:
            limits:
              cpus: 2
              memory: 2g
            reservations:
              cpus: 2
              memory: 2g
    command: >
      Eula=accept
      Billing={ENDPOINT_URI}
      ApiKey={API_KEY}
Related