Is possible to add service inside docker compose

Hi, Is it possible to add a service inside the docker compose file, using “PMM_AGENT_PRERUN_SCRIPT”? I’ve tried, but it doesn’t work. Is there any other way?
This is my code:

name: pmm-client
services:
  pmm-client-config1:
    container_name: pmm-client-config1
    restart: unless-stopped
    image: percona/pmm-client
    environment:
      PMM_AGENT_SERVER_ADDRESS: "xxx:443"
      PMM_AGENT_SERVER_USERNAME: "admin"
      PMM_AGENT_SERVER_PASSWORD: "apem12345"
      PMM_AGENT_SERVER_INSECURE_TLS: "1"
      PMM_AGENT_SETUP: "1"
      PMM_AGENT_SETUP_FORCE: "1"
      PMM_AGENT_CONFIG_FILE: "config/pmm-agent.yaml"
      PMM_AGENT_SETUP_NODE_NAME: "pmm-mongodb-config1"
      PMM_AGENT_SETUP_NODE_ADDRESS: "xxx:20001"
      PMM_AGENT_SETUP_NODE_TYPE: "container"
      PMM_AGENT_PRERUN_SCRIPT: "pmm-admin add mongodb --username=pmm --password=apem12345 --service-name=svc-config1 --host=xxx --port=20001 --cluster config --environment shard-cluster --replication-set=configrs --max-query-length=0 --query-source=profiler

Hi @Bram_Pratowo,
could you provide any logs?

This is the script used in our operators

1 Like