Search code examples
dockergramex

gramex docker | running multiple instances within docker


as per gramex-install-doc gramex could be started by running

# Run Gramex on port 9988
docker run --name gramex-instance -p 9988:9988 gramener/gramex

is it possible to start multiple gramex instances by changing --name parameter & different port numbers using -p parameter? when I tried to start gramex by:

docker run --name gramex-test-port -p 9998:9998 gramener/gramex

in the console it was still printing:

INFO    13-Apr 18:21:41 __init__ PORT Listening on port 9988

can multiple gramex instances be started using gramex-docker-install?


Solution

  • adding you application's gramex.yaml with below entry:

    app:
        listen:
            port: 9998
    

    and then starting docker container at the application directory with below params is starting gramex at required port

    docker run --name gramex-agri-prod -i -t -p 9998:9998 -v "$(pwd)":"$(pwd)" -w "$(pwd)"  gramener/gramex
    

    Note: include -d param to run it as deamon process