docs: update heroku's documentation (#1881)

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

View File

@@ -18,51 +18,24 @@ Alternatively, you can use this button to deploy the Medusa server to Heroku dir
## 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 dont, 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
- Gits 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
### 1. Install the Heroku 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
### 1. Login to Heroku from your CLI
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.
### 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:
@@ -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.
### 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.
@@ -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).
### 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.
@@ -202,7 +175,7 @@ heroku config:set STORE_CORS=<YOUR_STOREFRONT_URL>
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.
@@ -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: