Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running both of production and dev at same time #3601

Closed
webdeveloper0429 opened this issue Apr 10, 2018 · 2 comments
Closed

running both of production and dev at same time #3601

webdeveloper0429 opened this issue Apr 10, 2018 · 2 comments

Comments

@webdeveloper0429
Copy link

Great package!!!

module.exports = {
  apps : [
    {
      name      : 'appname',
      script    : './bin/www',
      env: {
        COMMON_VARIABLE: 'true',
        PORT: 3000
      },
      env_production : {
        NODE_ENV: 'production',
        PORT: 3001
      }
    },
  ],

  deploy : {
    production : {
      user : 'node',
      host : '123.123.123.123',
      ref  : 'origin/master',
      repo : 'git@bitbucket.org:username/appname.git',
      path : '/var/www/production',
      'post-deploy' : 'npm install && npm run webpack && pm2 reload ecosystem.config.js --env production'
    },
    dev : {
      user : 'node',
      host : '123.123.123.123',
      ref  : 'origin/develop',
      repo : 'git@bitbucket.org:username/appname.git',
      path : '/var/www/development',
      'post-deploy' : 'npm install && npm run webpack && pm2-dev reload ecosystem.config.js --env dev',
      env  : {
        NODE_ENV: 'dev'
      }
    }
  }
};

I was gonna run both of dev and production so that I can run production and staging on different port.
Btw, when I deploy production, dev is down,
and when I deploy dev, production is down.

is there any way to run both of them at same time?

Thanks in advance

@wallet77
Copy link
Contributor

Hi @starcraft0429

I think is not possible, and even if it is I would not recommend to launch same app on different environment on same server.
Maybe you can try to seperate dev and prod in two different ecosystem.config.js files and with different app's name.

@webdeveloper0429
Copy link
Author

Thanks for your responsive @wallet77
I think it is true, I made two cofig file than stable.config.js and staging.config.js.

and made separated deployment. ant it works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants