title: Can't run a bash script from docker-compose command in mongodb container
body: <p>Im trying to run a bash script in a mongo db container on start up, so i have a script file and i put the location of the script file in the command argument of my docker-compose, like so:</p>
  <pre><code>mongo1:
  container_name: mongo1
  image: mongo:4.4
  volumes:
    - ~/mongors/data1:/data/db
    - ./rs-init.sh:/scripts/rs-init.sh
  networks:
    - mongors-network
  ports:
    - 27021:27017
  links:
    - mongo2
    - mongo3
  restart: always
  entrypoint: [ &quot;/usr/bin/mongod&quot;, &quot;--bind_ip_all&quot;, &quot;--replSet&quot;, &quot;dbrs&quot; ]
  command: /scripts/rs-init.sh
  </code></pre>
  <p>But when i do docker-compose up, it says this command is invalid, then gives me all the options for mongodb commands:</p>
  <pre><code>Invalid command: /scripts/rs-init.sh
   Options:
     --networkMessageCompressors arg (=snappy,zstd,zlib)
                                           Comma-separated list of compressors to
                                           use for network messages
  
   General options:
     -h [ --help ]                         Show this usage information
     --version                             Show version information
     -f [ --config ] arg                   Configuration file specifying
  </code></pre>
  <p>How do i run this bash script in the container on startup?</p>