docs: added note about testing admin in backend deployment (#3808)
* docs: added a note about testing admin in backend deployment * added a note about admin build * added DATABASE_TYPE env variable
This commit is contained in:
@@ -263,6 +263,16 @@ Then, go to `<YOUR_APP_URL>/store/products`. If the deployment was successful, y
|
||||
|
||||

|
||||
|
||||
### Testing the Admin
|
||||
|
||||
:::note
|
||||
|
||||
Make sure to either set the `autoRebuild` option of the admin plugin to `true` or add its [build](../../admin/quickstart.mdx#build-command-options) command as part of the start command of your backend.
|
||||
|
||||
:::
|
||||
|
||||
If you deployed the admin dashboard alongside the backend, you can test it by going to `<YOUR_APP_URL>/app`. If you changed the admin path, make sure to change `/app` to the path you've set.
|
||||
|
||||
---
|
||||
|
||||
## Run Commands on Your Backend
|
||||
|
||||
@@ -239,6 +239,16 @@ The backend's URL is available under "Web URL". You can copy it and perform requ
|
||||
|
||||
For example, you can send a request to `<YOUR_BACKEND_URL>/store/products` and you should receive a JSON response with the products in your store.
|
||||
|
||||
### Testing the Admin
|
||||
|
||||
:::note
|
||||
|
||||
Make sure to either set the `autoRebuild` option of the admin plugin to `true` or add its [build](../../admin/quickstart.mdx#build-command-options) command as part of the `serve` command of your backend.
|
||||
|
||||
:::
|
||||
|
||||
If you deployed the admin dashboard alongside the backend, you can test it by going to `<YOUR_APP_URL>/app`. If you changed the admin path, make sure to change `/app` to the path you've set.
|
||||
|
||||
### Troubleshooting: Inspect Build Logs
|
||||
|
||||
If an error occurs during the deployment, you can explore your Heroku app build logs using the following command in the root directory of your Medusa backend:
|
||||
|
||||
@@ -5,6 +5,12 @@ addHowToData: true
|
||||
|
||||
# Deploy Your Medusa Backend on Qovery
|
||||
|
||||
:::warning
|
||||
|
||||
The deployment to Qovery rely on Docker. However, support and maintenance for Docker has been dropped in the [Medusa backend's default starter](https://github.com/medusajs/medusa-starter-default). So, the steps in this guide may not work as expected or can reference files that no longer exist in your step. It's kept for reference and to support previous deployments of Medusa to Qovery.
|
||||
|
||||
:::
|
||||
|
||||
In this document, you'll learn how to deploy your Medusa backend on Qovery with the help of Terraform.
|
||||
|
||||
[Qovery](https://www.qovery.com/) is a Continuous Deployment Platform that provides you with the developer experience of Heroku on top of your cloud provider (For example, AWS, DigitalOcean).
|
||||
@@ -434,12 +440,6 @@ Next, it creates a new project, environment, PostgreSQL database, and a Redis da
|
||||
|
||||
Finally, it creates the Medusa app and sets all the necessary environment variables needed to run it.
|
||||
|
||||
:::tip
|
||||
|
||||
This deployment uses Docker. By default, you should have the files [`Dockerfile`](https://github.com/medusajs/medusa-starter-default/blob/master/Dockerfile) and [`docker-compose.yml`](https://github.com/medusajs/medusa-starter-default/blob/master/docker-compose.yml)` in the root of your Medusa backend.
|
||||
|
||||
:::
|
||||
|
||||
### Change develop.sh
|
||||
|
||||
The `Dockerfile` runs the file `develop.sh` to start the backend. Change the content of `develop.sh` to the following:
|
||||
@@ -494,6 +494,16 @@ Once the command finishes and the deployment is successful, you can access your
|
||||
|
||||
You can access any of the endpoints on your backend using the backend URL. For example, you can get the list of products using the endpoint `/store/products`.
|
||||
|
||||
### Testing the Admin
|
||||
|
||||
:::note
|
||||
|
||||
Make sure to either set the `autoRebuild` option of the admin plugin to `true` or add its [build](../../admin/quickstart.mdx#build-command-options) command as part of the start command of your backend.
|
||||
|
||||
:::
|
||||
|
||||
If you deployed the admin dashboard alongside the backend, you can test it by going to `<YOUR_APP_URL>/app`. If you changed the admin path, make sure to change `/app` to the path you've set.
|
||||
|
||||
---
|
||||
|
||||
## Run Commands on the Backend
|
||||
|
||||
@@ -13,6 +13,12 @@ In this document, you’ll learn how to deploy your Medusa backend to Railway.
|
||||
|
||||
Railway provides a free plan that allows you to deploy your Medusa backend along with PostgreSQL and Redis databases. This is useful mainly for development and demo purposes.
|
||||
|
||||
:::note
|
||||
|
||||
If you're deploying the admin plugin along with the backend, you'll need at least the Developer plan. The resources provided by the starter plan will cause memory errors.
|
||||
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
@@ -90,12 +96,6 @@ On the Railway dashboard:
|
||||
|
||||
A new database will be created and, after a few seconds, you will be redirected to the project page where you will see the newly-created database.
|
||||
|
||||
To find the PostgreSQL database URL which you’ll need later:
|
||||
|
||||
1. Click on the PostgreSQL card.
|
||||
2. Choose the Connect tab.
|
||||
3. Copy the Postgres Connection URL.
|
||||
|
||||
### Create the Redis Database
|
||||
|
||||
In the same project view:
|
||||
@@ -106,12 +106,6 @@ In the same project view:
|
||||
|
||||
A new Redis database will be added to the project view in a few seconds. Click on it to open the database sidebar.
|
||||
|
||||
To find the Redis database URL which you’ll need later:
|
||||
|
||||
1. Click on the Redis card.
|
||||
2. Choose the Connect tab.
|
||||
3. Copy the Redis Connection URL.
|
||||
|
||||
|
||||
### Note about Modules
|
||||
|
||||
@@ -146,18 +140,21 @@ To configure the environment variables of your Medusa backend:
|
||||
PORT=9000
|
||||
JWT_SECRET=something
|
||||
COOKIE_SECRET=something
|
||||
DATABASE_URL=<YOUR_DATABASE_URL>
|
||||
REDIS_URL=<YOUR_REDIS_URL>
|
||||
DATABASE_URL=${{Postgres.DATABASE_URL}}
|
||||
REDIS_URL=${{Redis.REDIS_URL}}
|
||||
DATABASE_TYPE=postgres
|
||||
```
|
||||
|
||||
Where `<YOUR_DATABASE_URL>` and `<YOUR_REDIS_URL>` are the URLs you copied earlier when you created the PostgreSQL and Redis databases respectively.
|
||||
Notice that the values of `DATABASE_URL` and `REDIS_URL` reference the values from the PostgreSQL and Redis databases you created.
|
||||
|
||||
:::warning
|
||||
|
||||
It’s highly recommended to use strong, randomly generated secrets for `JWT_SECRET` and ****`COOKIE_SECRET`.
|
||||
It’s highly recommended to use strong, randomly generated secrets for `JWT_SECRET` and `COOKIE_SECRET`.
|
||||
|
||||
:::
|
||||
|
||||
Make sure to add any other environment variables that are relevant for you here. For example, you can add environment variables related to Medusa admin or your modules.
|
||||
|
||||
### Change Start Command
|
||||
|
||||
The start command is the command used to run the backend. You’ll change it to run any available migrations, then run the Medusa backend. This way if you create your own migrations or update the Medusa backend, it's guaranteed that these migrations are run first before the backend starts.
|
||||
@@ -169,7 +166,7 @@ To change the start command of your Medusa backend:
|
||||
3. Paste the following in the Start Command field:
|
||||
|
||||
```bash
|
||||
medusa migrations run && medusa develop
|
||||
medusa migrations run && medusa start
|
||||
```
|
||||
|
||||
### Add Domain Name
|
||||
@@ -194,6 +191,16 @@ If you generated a random domain, you can find it by clicking on the GitHub repo
|
||||
|
||||
:::
|
||||
|
||||
### Testing the Admin
|
||||
|
||||
:::note
|
||||
|
||||
Make sure to either set the `autoRebuild` option of the admin plugin to `true` or add its [build](../../admin/quickstart.mdx#build-command-options) command as part of the start command of your backend.
|
||||
|
||||
:::
|
||||
|
||||
If you deployed the admin dashboard alongside the backend, you can test it by going to `<YOUR_APP_URL>/app`. If you changed the admin path, make sure to change `/app` to the path you've set.
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -189,15 +189,6 @@ module.exports = {
|
||||
"https://res.cloudinary.com/dza7lstvk/image/upload/v1669739945/Medusa%20Docs/Other/aahqJp4_lbtfdz.png",
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
id: "deployments/server/deploying-on-qovery",
|
||||
label: "Deploy on Qovery",
|
||||
customProps: {
|
||||
image:
|
||||
"https://res.cloudinary.com/dza7lstvk/image/upload/v1669739955/Medusa%20Docs/Other/qOvY2dN_vogsxy.png",
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
id: "deployments/server/deploying-on-railway",
|
||||
@@ -210,6 +201,19 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "doc",
|
||||
id: "deployments/server/deploying-on-qovery",
|
||||
label: "Deploy on Qovery",
|
||||
customProps: {
|
||||
image:
|
||||
"https://res.cloudinary.com/dza7lstvk/image/upload/v1669739955/Medusa%20Docs/Other/qOvY2dN_vogsxy.png",
|
||||
badge: {
|
||||
variant: "orange",
|
||||
children: "Deprecated",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user