An open API service indexing awesome lists of open source software.

https://github.com/dominikg/medusa-starter-docker


https://github.com/dominikg/medusa-starter-docker

Last synced: 25 days ago
JSON representation

Awesome Lists containing this project

README

        

WARNING!!!! THIS IS JUST A REPRODUCTION REPOSITORY, DO NOT USE FOR ANYTHING ELSE BUT DEBUGGING



Medusa



Docker Medusa



This repo provides the basis for you to get started with a complete Medusa setup using docker compose. The complete setup includes:



  • `/backend`: Your Medusa instance, located in the backend folder


  • `/admin`: Medusa Admin where you control all aspects of your store


  • `/storefront`: Storefront for your customers to shop

**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.



Medusa is released under the MIT license.


PRs welcome!


Discord Chat


Follow @medusajs

---

## Setting up your Medusa

To set up Medusa in a development environment with Docker you should initially build the images since they are not published on dockerhub. This is accomplished by adding the `--build` flag as shown below:

```bash
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](https://docs.medusa-comerce.com) for further guides.



Website

|

Notion Home

|

Twitter

|

Docs