Skip to content

Latest commit

 

History

History
68 lines (46 loc) · 1.96 KB

DEPLOYMENT.md

File metadata and controls

68 lines (46 loc) · 1.96 KB

Deployment

Requirements

Heroku cli

Deploy

Clone the Heroku repo, if you haven't done so already:

$ heroku git:clone -a scopa-server
$ cd scopa-server

Make some changes to the code you just cloned and deploy them to Heroku using Git.

$ git add .
$ git commit -am "make it better"
$ git push heroku-scopa-server HEAD:main

Logs

To check Heroku live logs, do:

heroku --app scopa-server logs --tail

Setup

Below are described the steps taken to setup Scopa on Heroku.

Server

$ heroku create scopa-server --remote heroku-scopa-server

$ heroku buildpacks:add -a scopa-server heroku/nodejs
$ heroku buildpacks:add -a scopa-server heroku-community/multi-procfile

$ heroku config:set -a scopa-server PROCFILE=packages/server/Procfile
$ heroku config:set -a scopa-server HTTP_ORIGIN=https://scopa-client.herokuapp.com
$ heroku config:set -a scopa-server SOCKET_ORIGIN=https://scopa-client.herokuapp.com
$ heroku config:set -a scopa-server MONGODB_URL="mongodb+srv://<user>:<password>@two-of-spades.gbquq.mongodb.net/scopa?retryWrites=true&w=majority"

Client

$ heroku create scopa-client --remote heroku-scopa-client

$ heroku buildpacks:add -a scopa-client heroku-community/multi-procfile
$ heroku buildpacks:add -a scopa-client mars/create-react-app

$ heroku config:set -a scopa-client PROCFILE=packages/client/Procfile
$ heroku config:set -a scopa-client JS_RUNTIME_TARGET_BUNDLE="/app/packages/client/build/static/js/*.js"
$ heroku config:set -a scopa-client REACT_APP_HTTP_URL=https://scopa-server.herokuapp.com
$ heroku config:set -a scopa-client REACT_APP_SOCKET_URL=https://scopa-server.herokuapp.com

Useful links