Medusa Deployのロゴ

Medusa Deploy

組織
OrcaQubits
medusa-deploy

Deploy Medusa v2 to production — build process, server vs worker mode, environment variables, hosting options, Redis caching, database configuration, and production checklist. Use when deploying Medusa applications.

概要

公開者OrcaQubits
リポジトリagentic-commerce-skills-plugins
スキル名medusa-deploy
スター
40
フォーク
17
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    OrcaQubitsがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルMedusa DeployをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/medusa-commerce/skills/medusa-deploy
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OrcaQubits/agentic-commerce-skills-plugins.git /tmp/agentic-commerce-skills-plugins
mkdir -p .claude/skills
cp -r /tmp/agentic-commerce-skills-plugins/medusa-commerce/skills/medusa-deploy .claude/skills/medusa-deploy
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでMedusa Deployを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にMedusa Deployを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Medusa Deployは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Medusa v2 Deployment

Before writing code

Fetch live docs:

  1. Web-search site:docs.medusajs.com deployment production for production deployment guides
  2. Web-search site:docs.medusajs.com medusa build for build process details
  3. Fetch https://docs.medusajs.com/resources/medusa-cli for CLI command reference
  4. Web-search site:docs.medusajs.com environment variables configuration for env var reference
  5. Web-search site:docs.medusajs.com redis cache events for Redis caching and event bus setup

Build Process

Build Commands

CommandPurpose
npx medusa buildCompile server + admin dashboard for production
npx medusa db:migrateRun pending database migrations
npx medusa startStart the production server
npx medusa workerStart the background worker process

The build step compiles TypeScript, bundles admin extensions (Vite), and prepares the .medusa/ output directory.

Build Output Structure

.medusa/
├── server/           — Compiled server code
│   ├── src/          — Custom modules, routes, workflows
│   └── medusa-config.js
└── admin/            — Bundled admin dashboard (static)

Server vs Worker Mode

Medusa v2 supports running the server and background workers as separate processes:

ModeCommandHandles
Servernpx medusa startHTTP requests, API routes, admin dashboard
Workernpx medusa workerWorkflows, scheduled jobs, event subscribers
CombinedDefault start behaviorBoth server and worker (single process)

When to Separate

  • Development — combined mode is fine
  • Production — separate for reliability and independent scaling
  • High traffic — scale server instances independently from workers
  • Worker mode requires Redis for job queue communication between processes

Environment Variables

Required Variables

VariablePurposeExample
DATABASE_URLPostgreSQL connection stringpostgres://user:pass@host:5432/medusa
COOKIE_SECRETSession cookie signingRandom 32+ character string
JWT_SECRETJWT token signingRandom 32+ character string
NODE_ENVRuntime environmentproduction

Optional but Recommended

VariablePurposeDefault
REDIS_URLRedis connection for cache/events/workersNone (in-memory)
STORE_CORSStore API CORS originshttp://localhost:8000
ADMIN_CORSAdmin API CORS originshttp://localhost:9000
AUTH_CORSAuth route CORS originsCombination of store + admin
PORTServer listen port9000
MEDUSA_ADMIN_ONBOARDING_TYPEAdmin onboarding flowdefault
MEDUSA_WORKER_MODEserver, worker, or sharedshared

Database Configuration

PostgreSQL Requirements

  • PostgreSQL required (see official docs for version compatibility)
  • Enable SSL in production: append ?sslmode=require to DATABASE_URL
  • Connection pooling recommended for high-traffic deployments

Migration Workflow

bash
# Generate migration after DML model changes
npx medusa db:generate <module_name>
# Apply migrations
npx medusa db:migrate
  • Always run migrations before starting the new server version
  • Back up the database before running migrations in production
  • Test migrations against a staging database first

Redis Configuration

Redis serves three roles in production Medusa:

RolePurposeRequired?
Event BusPub/sub for event-driven subscribersRecommended
CacheModule data caching layerRecommended
Worker QueueJob queue for background workflowsRequired for worker mode

Configure in medusa-config.ts by registering the Redis modules:

ts
// Fetch live docs for Redis module registration
// in medusa-config.ts modules array
  • Use separate Redis databases (db index) for cache vs events vs queues
  • Set appropriate maxmemory and eviction policies for cache
  • Monitor Redis memory usage and connection count in production

Hosting Options

PlatformTypeNotes
RailwayPaaSOne-click deploy, managed PostgreSQL and Redis
DigitalOcean App PlatformPaaSManaged infrastructure, auto-scaling
AWS (EC2/ECS/Fargate)IaaS/CaaSFull control, use with RDS and ElastiCache
Google Cloud RunServerless containersAuto-scaling, pay-per-use
RenderPaaSSimple deploy, managed databases
Self-hosted (Docker)ContainerFull control, use Docker Compose or Kubernetes
VercelServerlessAdmin/storefront hosting only (not the Medusa server)

Docker Deployment

dockerfile
# Fetch live docs for official Medusa Dockerfile
# and docker-compose.yml patterns

A typical Docker Compose setup includes three services: Medusa server, PostgreSQL, and Redis.

Production Checklist

Pre-Deploy

  • Set NODE_ENV=production
  • Configure unique COOKIE_SECRET and JWT_SECRET
  • Set DATABASE_URL with SSL mode enabled
  • Configure REDIS_URL for events, cache, and worker queue
  • Set CORS variables (STORE_CORS, ADMIN_CORS, AUTH_CORS)
  • Run npx medusa build successfully
  • Run npx medusa db:migrate against production database

Infrastructure

  • PostgreSQL with automated backups and point-in-time recovery
  • Redis with persistence enabled (RDB or AOF)
  • HTTPS termination (TLS certificate) via reverse proxy or load balancer
  • Health check endpoint configured for load balancer
  • Log aggregation (stdout/stderr to centralized logging)

Post-Deploy

  • Verify admin dashboard loads and login works
  • Verify store API responds with publishable key
  • Confirm background workers are processing jobs
  • Test payment provider webhooks reach the server
  • Monitor error rates and response times

Scaling Strategies

Horizontal Scaling

  • Run multiple server instances behind a load balancer
  • Use Redis-backed sessions for sticky-session-free scaling
  • Run multiple worker instances for parallel job processing

Vertical Scaling

  • Increase PostgreSQL connection pool size for heavier workloads
  • Allocate more memory to Redis for larger cache datasets
  • Use --max-old-space-size for Node.js memory limits

Best Practices

  • Separate server and worker — run as independent processes in production; scale each based on demand; use Redis as the communication backbone
  • Environment variable hygiene — never commit secrets to source control; use platform-native secret management (AWS Secrets Manager, Railway variables, etc.); rotate secrets periodically
  • Database management — always test migrations on staging first; automate backups; use connection pooling (PgBouncer) for high concurrency
  • Monitoring — track API response times, worker queue depth, database connection count, and Redis memory; set alerts for anomalies

Fetch the Medusa deployment documentation for exact build flags, Docker configuration, and platform-specific deployment guides before deploying.

よくある質問

AIスキル「Medusa Deploy」では何ができますか?

Deploy Medusa v2 to production — build process, server vs worker mode, environment variables, hosting options, Redis caching, database configuration, and production checklist. Use when deploying Medusa applications.

TypingMindでMedusa Deployを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Medusa Deployはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにMedusa Deployをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/medusa-commerce/skills/medusa-deployを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Medusa Deployを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Medusa Deployは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもMedusa Deployを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Medusa Deploy」は無料ですか?

はい。OrcaQubitsがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇