docs: update heroku's documentation (#1881)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2022-07-20 12:24:59 +03:00
1 parent 45dcf420c6
commit ef84b104e6
3 files changed
+25 -54

No files matched your search

@@ -16,9 +16,8 @@ Additionally, this documentation does not cover how to deploy the Medusa server.
### Needed Accounts ### Needed Accounts
You need a Netlify account to deploy the Medusa Admin. If you don’t have one, you can create one on [Netlify’s website](https://app.netlify.com/signup?_ga=2.249228995.556918419.1656505909-2004101041.1655191129). - A [Netlify](https://app.netlify.com/signup) account to deploy the Medusa Admin.
- A [GitHub](https://github.com/signup) account where you will host the repository for the Medusa admin.
Additionally, you need a GitHub account where you will host the repository for the Medusa admin. You can create it on [GitHub’s website](https://github.com/signup).
:::tip :::tip
@@ -28,7 +27,7 @@ If you want to use another Git Provider, it’s possible to follow along with th
### Required Tools ### Required Tools
Git’s CLI tool is required while following along with this tutorial. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git). - Git’s CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git).
## Create GitHub Repository ## Create GitHub Repository
@@ -18,51 +18,24 @@ Alternatively, you can use this button to deploy the Medusa server to Heroku dir
## Prerequisites ## Prerequisites
Before you start with this guide, you must have a Medusa server installed locally. ### Medusa Server
To install a Medusa server, follow our [Quickstart guide](../../quickstart/quick-start.md). It is assumed that you already have a Medusa server installed locally. If you don’t, please follow our [quickstart guide](../../quickstart/quick-start.md).
Furthermore, your Medusa server should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Server documentation](../../usage/configurations.md) to learn how to do that.
### Needed Accounts
- A [Heroku](https://heroku.com/) account.
### Required Tools
- Git’s CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git).
- Heroku's CLI tool. You can follow [Heroku's documentation to learn how to install it for your operating system](https://devcenter.heroku.com/articles/heroku-cli).
## How to Deploy Your Medusa Server on Heroku ## How to Deploy Your Medusa Server on Heroku
### 1. Install the Heroku CLI ### 1. Login to Heroku from your CLI
Install the Heroku CLI tool using the instructions that belong to your operating system.
<Tabs groupId="operating-systems" wrapperClassName={styles.osTabs}>
<TabItem value="windows" label="Windows" default>
Download the appropriate installer for your Windows installation:
[64-bit installer](https://cli-assets.heroku.com/heroku-x64.exe)
[32-bit installer](https://cli-assets.heroku.com/heroku-x86.exe)
</TabItem>
<TabItem value="linux" label="Linux">
For Ubuntu, you can use the following command:
```bash
sudo snap install --classic heroku
```
As for other Linux distributions, please check [Heroku's guide](https://devcenter.heroku.com/articles/heroku-cli#standalone-installation-with-a-tarball).
</TabItem>
<TabItem value="macos" label="macOS">
For macOS you can install Heroku's CLI tool using Homebrew:
```bash
brew tap heroku/brew && brew install heroku
```
For other installation options, please check [Heroku's guide](https://devcenter.heroku.com/articles/heroku-cli#standalone-installation-with-a-tarball)
</TabItem>
</Tabs>
### 2. Login to Heroku from your CLI
Before you can create an app with Heroku, you must login with the CLI tool: Before you can create an app with Heroku, you must login with the CLI tool:
@@ -72,7 +45,7 @@ heroku login
Depending on your operating system, you must follow either the instructions in your terminal or a page in your browser will open. Depending on your operating system, you must follow either the instructions in your terminal or a page in your browser will open.
### 3. Create an App with Heroku ### 2. Create an App with Heroku
In the root directory of your Medusa server, run the following commands to create an app on Heroku and add it as a remote origin: In the root directory of your Medusa server, run the following commands to create an app on Heroku and add it as a remote origin:
@@ -83,7 +56,7 @@ heroku git:remote -a <APP_NAME>
Where `<APP_NAME>` is the name of the app you'll create. You can use any name you want. Where `<APP_NAME>` is the name of the app you'll create. You can use any name you want.
### 4. Install Postgresql and Redis on Heroku ### 3. Install Postgresql and Redis on Heroku
Medusa requires a Postgres database and a Redis instance to work. You can add those to your Heroku app using Add-ons. Medusa requires a Postgres database and a Redis instance to work. You can add those to your Heroku app using Add-ons.
@@ -131,7 +104,7 @@ heroku addons:create upstash-redis
This uses the free plan of Upstash. Make sure to check out [more information regarding the plans and pricing of Upstash](https://elements.heroku.com/addons/upstash-redis#pricing). This uses the free plan of Upstash. Make sure to check out [more information regarding the plans and pricing of Upstash](https://elements.heroku.com/addons/upstash-redis#pricing).
### 5. Configure Environment Variables on Heroku ### 4. Configure Environment Variables on Heroku
Medusa requires a set of environment variables to be configured. You can learn more about Medusa's configurations in the [Configure your Medusa Server](../../usage/configurations.md) document. Medusa requires a set of environment variables to be configured. You can learn more about Medusa's configurations in the [Configure your Medusa Server](../../usage/configurations.md) document.
@@ -202,7 +175,7 @@ heroku config:set STORE_CORS=<YOUR_STOREFRONT_URL>
Where `<YOUR_STOREFRONT_URL>` is the URL of your storefront. Where `<YOUR_STOREFRONT_URL>` is the URL of your storefront.
### 6. Configure Medusa Server ### 5. Configure Medusa Server
Before jumping into the deployment, you need to configure your Medusa server to ensure it uses the previous environment variables and the recommended production configurations. Before jumping into the deployment, you need to configure your Medusa server to ensure it uses the previous environment variables and the recommended production configurations.
@@ -241,7 +214,7 @@ Update `scripts` to include the following scripts:
}, },
``` ```
### 7. Launch your Medusa Server ### 6. Launch your Medusa Server
Finally, commit and push all changes to Heroku: Finally, commit and push all changes to Heroku:
@@ -16,9 +16,8 @@ Additionally, this documentation does not cover how to deploy the Medusa server.
### Needed Accounts ### Needed Accounts
You need a Netlify account to deploy the Gatsby storefront. If you don’t have one, you can create one on [Netlify’s website](https://app.netlify.com/signup). - A [Netlify](https://app.netlify.com/signup) account to deploy the Gatsby storefront.
- A [GitHub](https://github.com/signup) account where you will host the repository for the Gatsby storefront.
Additionally, you need a GitHub account where you will host the repository for the Gatsby storefront. You can create it on [GitHub’s website](https://github.com/signup).
:::tip :::tip
@@ -28,7 +27,7 @@ If you want to use another Git Provider, it’s possible to follow along with th
### Required Tools ### Required Tools
Git’s CLI tool is required while following along with this tutorial. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git). - Git’s CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git).
## Create GitHub Repository ## Create GitHub Repository