This tutorial is designed to assist people who want to have a step-by-step guide to deploy the Lumber-generated back office to Heroku.
If you don’t have a Heroku account yet, sign up here. Then, create your first Heroku application (1) (2).
After creating your application, simply follow the Heroku guide “Deploy using Heroku Git” to push the lumber-generated back office code to the Heroku application.
Push your code using the following command:
git push heroku master
Your Heroku application is now successfully deployed. The last step to have a complete running application is to deploy a database remotely. In this case, we recommend adding on your Heroku application the free add-on “Heroku Postgres” (1)(2).
Once installed, your Heroku application will contain an environment variable
DATABASE_URL with the credentials of your new created database (1). The “Config Vars” section (2) in the Settings tab is where you will configure the
FOREST_AUTH_SECRET environment variables later (3).
Your new database has no data yet, so you will need to import your local data to this new one.
To do that, you first need to create a dump of your local database.
PGPASSWORD=secret pg_dump -h localhost -p 5416 -U forest forest_demo --no-owner --no-acl -f database.dump
Then, you need to import it to the Heroku database.
heroku pg:psql DATABASE_URL --app lumber-deploy-to-production < database.dump
At this stage, your Heroku application is entirely running with its own database. 🎉 You can make sure by checking the Heroku logs using the command
heroku logs -t -a <name_of_your_app>
heroku logs -t -a lumber-deploy-to-production
Now your back office server is running on Heroku, you can go back to your Forest interface to finalize your production environment. Check out here how to do it.