docs: changes to deployment + remove admin deployment guides (#10345)

* docs: change headings and text in deployment

* remove admin deployment guide

* generate changes
This commit is contained in:
Shahed Nasser
2024-11-28 14:48:10 +02:00
committed by GitHub
parent aca7907d81
commit 768f970926
9 changed files with 35 additions and 279 deletions
@@ -39,7 +39,7 @@ When you deploy your Medusa application, make sure your chosen hosting provider
1. PostgreSQL database: If your hosting provider doesn't support database hosting, you must find another hosting provider for the PostgreSQL database.
2. Redis database: If your hosting provider doesn't support database hosting, you must find another hosting provider for the Redis database.
3. Medusa application in server and worker mode. This means your hosting provider should support deploying two applications or instances from the same codebase.
5. If you're also hosting the Medusa Admin with the server, the hosting provider and plan should offer at least 2GB of RAM.
4. For optimal experience, the hosting provider and plan must offer at least 2GB of RAM.
---
@@ -68,18 +68,7 @@ Later, youll set different values of the `MEDUSA_WORKER_MODE` environment var
### Configure Medusa Admin
There are two cases where you may disable the Medusa Admin in your deployed Medusa application:
1. If you choose to host it separately.
2. In the Medusa application running in worker mode, as it doesnt need to run the admin.
<Note>
To host the admin with the Medusa application, the hosting provider and plan should offer at least 2GB of RAM.
</Note>
So, add the following configuration in `medusa-config.ts`:
You need to disable the Medusa Admin in the worker Medusa application, while keeping it enabled in the server Medusa application. So, add the following configuration in `medusa-config.ts`:
```ts title="medusa-config.ts"
module.exports = defineConfig({
@@ -208,7 +197,6 @@ JWT_SECRET=supersecret # TODO GENERATE SECURE SECRET
STORE_CORS= # STOREFRONT URL
ADMIN_CORS= # ADMIN URL
AUTH_CORS= # STOREFRONT AND ADMIN URLS, SEPARATED BY COMMAS
# change to false if you're hosting the admin with the application
DISABLE_MEDUSA_ADMIN=true
MEDUSA_WORKER_MODE=server
PORT=9000
@@ -220,9 +208,9 @@ Where:
- The value of `COOKIE_SECRET` and `JWT_SECRET` must be a randomly generated secret.
- `STORE_CORS`'s value is the URL of your storefront. If you dont have it yet, you can skip adding it for now.
- `ADMIN_CORS`'s value is the URL of the admin dashboard. If you dont have it yet, or youre deploying the admin with the Medusa application, you can skip adding it for now.
- `ADMIN_CORS`'s value is the URL of the admin dashboard, which is the same as the server Medusa application. You can add it later if you don't currently have it.
- `AUTH_CORS`'s value is the URLs of any application authenticating users, customers, or other actor types, such as the storefront and admin URLs. The URLs are separated by commas. If you dont have the URLs yet, you can set its value later.
- Change `DISABLE_MEDUSA_ADMIN` to `false` if youre hosting the admin with the Medusa application.
- Set `DISABLE_MEDUSA_ADMIN`'s value to `false` so that the admin is built with the server application.
- Set the PostgreSQL database's connection URL as the value of `DATABASE_URL`
- Set the Redis database's connection URL as the value of `REDIS_URL`.
@@ -240,11 +228,9 @@ If your hosting provider doesn't support setting a current-working directory, se
cd .medusa/server && npm run predeploy && npm run start
```
### Additional Configuration if Deploying with Admin
### Set Backend URL in Admin Configuration
If youre deploying the Medusa application in server mode with the admin, you have to make some changes after youve obtained the applications URL.
First, add the following configuration to `medusa-config.ts`:
After youve obtained the Medusa applications URL, add the following configuration to `medusa-config.ts`:
```ts title="medusa-config.ts"
module.exports = defineConfig({
@@ -299,7 +285,7 @@ REDIS_URL= # REDIS DATABASE URL
Where:
- The value of `COOKIE_SECRET` and `JWT_SECRET` must be a randomly generated secret.
- Keep `DISABLE_MEDUSA_ADMIN`'s value set to `true`, even if youre hosting the admin with the Medusa application.
- Set `DISABLE_MEDUSA_ADMIN`'s value to `true` so that the admin isn't built with the worker application.
- Set the PostgreSQL database's connection URL as the value of `DATABASE_URL`
- Set the Redis database's connection URL as the value of `REDIS_URL`.
@@ -323,9 +309,7 @@ cd .medusa/server && npm run predeploy && npm run start
Once the application is deployed and live, go to `<APP_URL>/health`, where `<APP_URL>` is the URL of the Medusa application in server mode. If the deployment was successful, youll see the `OK` response.
### Open Deployed Medusa Admin
If you deployed the Medusa Admin with the application, itll be available at `<APP_URL>/app`.
The Medusa Admin is also available at `<APP_URL>/app`.
---
+8 -44
View File
@@ -15,26 +15,22 @@ A standard Medusa project is made up of:
![Diagram showcasing the connection between the three deployed components](https://res.cloudinary.com/dza7lstvk/image/upload/v1708600807/Medusa%20Book/deployment-options_ceuuvo.jpg)
You can either deploy the Medusa application fully (server with the admin), or deploy the Medusa Admin separately. The storefront is always deployed separately.
You deploy the Medusa application, with the server and admin, separately from the storefront.
---
## Deploying the Medusa Server
## Deploying the Medusa Application
You must deploy the Medusa server before the admin or storefront, as both of them connect to it and wont work without a deployed Medusa server URL.
You must deploy the Medusa application before the storefront, as it connects to the server and wont work without a deployed Medusa server URL.
The Medusa application must be deployed to a hosting provider supporting Node.js server deployments, such as Railway, DigitalOcean, AWS, Heroku, etc…
![Diagram showcasing how the Medusa server and its associated services would be deployed](https://res.cloudinary.com/dza7lstvk/image/upload/v1708600972/Medusa%20Book/backend_deployment_pgexo3.jpg)
The Medusa server must be deployed to a hosting provider supporting Node.js server deployments, such as Railway, DigitalOcean, AWS, Heroku, etc…
<Note title="Tip">
For optimal experience, make sure that the hosting provider and plan offer at least 2GB of RAM.
</Note>
Your server connects to a PostgreSQL database, Redis, and other services relevant for your setup. Most hosting providers support deploying and managing these databases along with your Medusa server (such as Railway and DigitalOcean).
When you deploy your Medusa application, you also deploy the Medusa Admin. For optimal experience, your hosting provider and plan must offer at least 2GB of RAM.
### How to Deploy Medusa?
Medusa Cloud is our managed services offering that makes deploying and operating Medusa applications possible without having to worry about configuring, scaling, and maintaining infrastructure. Medusa Cloud hosts your server, Admin dashboard, database, and Redis instance.
@@ -48,39 +44,7 @@ With Medusa Cloud, you maintain full customization control as you deploy your ow
[Sign up and learn more about Medusa Cloud](https://medusajs.com/contact)
To self-host Medusa, the [next chapter](./general/page.mdx) explains the general steps to deploy your Medusa application.
Refer to [this reference](!resources!/deployment) to find how-to deployment guides for general and specific hosting providers.
---
## Deploying the Medusa Admin
### Deploy Admin with the Server
The Medusa Admin can be deployed on the same hosting with the server.
In this scenario, make sure the hosting provider and plan of your choice provide at least 2GB of RAM, as the admin build requires high RAM usage.
![Diagram showcasing how the admin would be deployed along with the Medusa server.](https://res.cloudinary.com/dza7lstvk/image/upload/v1708601021/Medusa%20Book/admin_deployment_1_lyg4cp.jpg)
<Note title="Tip">
The [server deployment guides](!resources!/deployment) mention details on how to deploy the admin with the Medusa server.
</Note>
### Deploy Admin Separately
You can deploy the admin into a separate hosting provider or instance. The admin can be hosted on providers that support front-end websites and frameworks, such as Vercel.
<Note title="Important">
Per Vercels [license and plans](https://vercel.com/pricing), their free plan can only be used for personal, non-commercial projects. So, you can deploy the Medusa Admin on the free plan for development purposes, but for commercial projects, you must update your Vercel plan.
</Note>
Refer to [this reference](!resources!/deployment) to find how-to deployment guides for specific hosting providers.
To self-host Medusa, the [next chapter](./general/page.mdx) explains the general steps to deploy your Medusa application. Refer to [this reference](!resources!/deployment) to find how-to deployment guides for general and specific hosting providers.
---