pm2playframework-1.x

Deploy Play Framework 1.5 with pm2


I'm trying to deploy my Play App using pm2 through ecosystem file. The application runs but the pm2 fail for 15 times and stop, leaving only the java process running.

Bellow my ecosystem json file:

{
    "apps": [{
            "name": "Starter",
            "cwd": ".",
            "args": [
                "start"
            ],
            "script": "/home/play/play-1.5.3/play",
            "interpreter" : "/usr/bin/python3",
            "node_args": [],
            "log_date_format": "YYYY-MM-DD HH:mm Z",
            "exec_interpreter": "none",
            "exec_mode": "fork"
        }
    ]
}

Is there a way to do that?

EDIT 1

I'm running the script from project root


Solution

  • I have the same issue, and solved changing the argument "start" to "run", like that:

    {
    "apps": [{
            "name": "Starter",
            "cwd": ".",
            "args": [
                "run"
            ],
            "script": "/home/play/play-1.5.3/play",
            "interpreter" : "/usr/bin/python3",
            "node_args": [],
            "log_date_format": "YYYY-MM-DD HH:mm Z",
            "exec_interpreter": "none",
            "exec_mode": "fork"
        }
    ]
    

    }

    For some reason, when you send the "run" argument, play understands that you are making two calls, so pm2 prints two outputs: one actually start and the other with the information that there is already an instance started. When i've changed, delete the instance from pm2 and start again, the pm2 logs printed correctly.

    Hope that works for you! :)