• Stars
    star
    133
  • Rank 264,467 (Top 6 %)
  • Language
    Dockerfile
  • Created over 2 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This repo is managed by the Medusa Community. Medusa does not provide official support for Docker, but we will accept fixes and documentation. Use at your own risk.

Medusa

Medusa

Medusa is an open-source headless commerce engine that enables developers to create amazing digital commerce experiences.

Medusa is released under the MIT license. PRs welcome! Product Hunt Discord Chat Follow @medusajs

Please note

This repo is managed by the Medusa Community. Medusa does not provide official support for Docker, but we will accept fixes and documentation. Use at your own risk.

This project is inteded for development only at this time.

The files for both the Medusa server and the Storefront are loaded in Bind Mounts allowing you to change the server functionality and have the change be hot-reloaded onto your running containers.


Requirements

To use Docker with Medusa, you should have created a Medusa project. Check out our Quickstart to get started.

Additionally, you should have docker and docker-compose installed on your system.

Getting Started

To set up Medusa in a development environment with Docker, you should copy files docker-compose.yml, docker-compose.override.yml, backend/develop.sh, and backend/Dockerfile` to your Medusa project.

Then build the images since they are not published on dockerhub. This is accomplished by adding the --build flag as shown below:

docker compose up --build

Having already built the Docker images you can run docker compose without the --build flag.

docker compose up

Your local Medusa setup is now running with each of the services occupying the following ports:

  • Medusa Server: 9000
  • Medusa Admin: 7000
  • Storefront: 8000
  • postgres: 5432
  • redis: 6379

Note: If you change the dependencies of your projects by adding new packages you can simply rebuild that package with the same tag test and run docker compose up once again to update your environment.

Seeding your Medusa store

To add seed data to your medusa store run this command in a seperate

docker exec medusa-server medusa seed -f ./data/seed.json

Running Medusa with docker in production

This repository and each of the services contain dockerfiles for both development and production, named Dockerfile and Dockerfile.prod respectively. The Dockerfile.prod copies the local files from disk and builds a production ready image based on your local development progress. Your specific needs for a production like container might differ from the Dockerfile.prod but it should provide a template and an idea of the requirements for each of the basic services.

To run the services in a production state docker compose is simply run with the docker-compose.production.yml file as well as the basic docker-compose.yml file as seen below. If you wish to build the production ready images and then start them run docker compose up with the --build flag as described above.

docker compose up -f docker-compose.yml -f docker-compose.production.yml up

docker-compose.production.yml contains production relevant overrides to the services described in the docker-compose.yml development file.

Try it out

curl -X GET localhost:9000/store/products | python -m json.tool

After the seed script has run you will have the following things in you database:

  • a User with the email: [email protected] and password: supersecret
  • a Region called Default Region with the countries GB, DE, DK, SE, FR, ES, IT
  • a Shipping Option called Standard Shipping which costs 10 EUR
  • a Product called Cool Test Product with 4 Product Variants that all cost 19.50 EUR

Visit docs.medusa-commerce.com for further guides.

Website | Notion Home | Twitter | Docs

More Repositories

1

medusa

Building blocks for digital commerce
TypeScript
23,086
star
2

nextjs-starter-medusa

A performant frontend ecommerce starter template with Next.js 14 and Medusa.
TypeScript
1,333
star
3

admin

Admin system for Medusa Stores
TypeScript
428
star
4

ui

Medusa's admin component library
TypeScript
94
star
5

medusa-starter-default

TypeScript
92
star
6

gatsby-starter-medusa

A production-ready Gatsby starter for Medusa
JavaScript
80
star
7

medusa-express-nextjs

One-page checkout flow
JavaScript
66
star
8

product-module-demo

Product Module demo
TypeScript
28
star
9

gatsby-starter-medusa-simple

A simple Gatsby front-end for a Medusa project
JavaScript
22
star
10

hackathon-oct2022-guidelines

Guidelines to Participate in Medusa's 2022 Hackathon
20
star
11

medusa-express-gatsby

Medusa One Page Checkout
JavaScript
19
star
12

medusa-contentful-storefront

A storefront for Medusa Starter Contentful
JavaScript
16
star
13

medusa-plugin-template

A template for building Medusa plugins
JavaScript
14
star
14

.github

medusajs.github
12
star
15

medusa-starter-contentful

A Medusa starter that works with Contentful
JavaScript
11
star
16

docker-medusa-temp

Temporary repo for creating a `docker-compose` setup for Medusa
JavaScript
10
star
17

workflow-examples

TypeScript
7
star
18

gatsby-source-medusa

Gatsby source plugin for building websites using Medusa as a data source.
TypeScript
5
star
19

reservation-try-on-demo

TypeScript
5
star
20

gatsby-theme-medusa-admin

JavaScript
5
star
21

gatsby-theme-medusaadmin

Gatsby theme based on Medusa admin system to manage Medusa Stores
JavaScript
5
star
22

hackathon-oct2022

Overview of Submissions to Medusa's Hackathon 2022
5
star
23

tutorial-template

Template for Repositories of Tutorials on Our Blog
4
star
24

medusa-vercel-commerce

JavaScript
4
star
25

plugins-readme-template

A README template for Medusa Plugins
1
star
26

roadmap

1
star