Nawi
Nawi

Reputation: 1

How I can run different production environments on servers?

There is project on react, where is production and development. A project on a virtual server was launched in production. The task is to run another version of the project with a different environment to the virtual server. The problem is that you cannot specify multiple versions of the .env.prodaction file. I tried to run development - TeamCity hangs, tried to change production environment variables directly in teamCity - also does not work. A set of commands with which I run on a virtual server:

Upvotes: 0

Views: 207

Answers (1)

Nawi
Nawi

Reputation: 1

Solution found. I create a file .env.staging and add a new script to my package.json.

{
  "scripts": {
    "build:staging": "env-cmd -f .env.staging npm run build"
  }
}

Upvotes: 0

Related Questions