ohif-viewer/docs/latest/deployment/recipes/build-for-production.md
2019-04-30 09:52:51 -04:00

2.7 KiB

Build for Production

If you've already followed the "Getting Started" Guide, you can skip ahead to Configuration

Overview?

Build Machine Requirements

Getting the Code

With Git:

# Clone the remote repository to your local machine
git clone https://github.com/OHIF/Viewers.git

# Make sure the local code reflects the `react` version of the OHIF Viewer
git checkout react

More on: git clone, git checkout

From .zip:

OHIF/Viewers: react.zip

Restore Dependencies & Build

Open PowerShell, Terminal, or a Command Prompt, and navigate to the directory containing the source files. Next run these commands:

// Restore dependencies
yarn install

// Build source code for production
yarn run build:web

If everything worked as expected, you should have a new build/ directory in the project's folder. It should roughly resemble the following:

build
├── config/
├── static/
├── index.html
├── manifest.json
├── service-worker.js
└── ...

These files can be hosted using

Configuration

...

  • env vars
  • REACT_APP_*
  • config file(s)

Next Steps

Deploying our Production Build

TODO: List of recipes

Automating Builds and Deployments

If you found setting up your environmnent and running all of these steps to be a bit tedious, then you are in good company. Thankfully, there are a large number of tools available to assist with automating tasks like building and deploying web application. For a starting point, check out this repository's own use of:

Troubleshooting

Issues and resolutions for common GitHub issues will be summarized here

...