All Saleor services started from a single repository
Keep in mind this repository is for local development only and is not meant to be deployed in any production environment! If you're not a developer and just want to try out Saleor you can check our live demo.
This project contains several projects that are connected. The main
branch is always stable, but if modules were updated individually, it's possible they will not work correctly.
In case of problems, fetching new saleor-platform is recommended. If local repository must be kept, consider updating to commit hashes that are pointed from main
branch of saleor-platform.
To fetch fresh repository, follow section below
To clone the repository, run the following command
git clone https://github.com/saleor/saleor-platform.git --recursive --jobs 3
We prepared a few make
commands for you
make
make run
make run-backend
See Makefile for all commands
-
We are using shared folders to enable live code reloading. Without this, Docker Compose will not start:
- Windows/MacOS: Add the cloned
saleor-platform
directory to Docker shared directories (Preferences -> Resources -> File sharing). - Windows/MacOS: Make sure that in Docker preferences you have dedicated at least 5 GB of memory (Preferences -> Resources -> Advanced).
- Linux: No action is required, sharing is already enabled and memory for the Docker engine is not limited.
- Windows/MacOS: Add the cloned
-
Go to the cloned directory:
cd saleor-platform
- Build the application:
docker-compose build
- Apply Django migrations:
docker-compose run --rm api python3 manage.py migrate
- Collect static files:
docker-compose run --rm api python3 manage.py collectstatic --noinput
- Populate the database with example data and create the admin user:
docker-compose run --rm api python3 manage.py populatedb --createsuperuser
Note that --createsuperuser
argument creates an admin account for admin@example.com
with the password set to admin
.
- Run the application:
docker-compose up
Both Storefront and Dashboard are quite big frontend projects and it might take up to a few minutes for them to compile depending on your CPU. If nothing shows up on port 3001 or 9000, please wait until Compiled successfully
shows in the console output.
- Saleor Core (API) - http://localhost:8000
- Saleor React Storefront - http://localhost:3001
- Saleor Dashboard - http://localhost:9000
- Jaeger UI (APM) - http://localhost:16686
- Mailhog (Test email interface) - http://localhost:8025
This repository contains the newest stable versions. When a new release is published, pull a new version of this repository. In order to update all of the subprojects to their newest versions, run:
git submodule update --remote
You can find the latest version of Saleor, Storefront and Dashboard in their individual repositories:
- https://github.com/saleor/saleor
- https://github.com/saleor/saleor-dashboard
- https://github.com/saleor/react-storefront
Most of the time both issues can be solved by cleaning up space taken by old containers. After that, we build again whole platform.
- Make sure docker stack is not running
docker-compose stop
- Remove existing volumes
Warning! Proceeding will remove also your database container! If you need existing data, please remove only services that cause problems! https://docs.docker.com/compose/reference/rm/
docker-compose rm
- Build fresh containers
docker-compose build
- Now you can run a fresh environment using commands from
How to run it?
section. Done!
If you are getting issues with lack of available space, consider pruning your docker cache:
Warning! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all dangling build cache
More info: https://docs.docker.com/engine/reference/commandline/system_prune/
I've been warned
docker system prune
Please submit an issue ticket if you spot issues with database migrations during the version update.
When testing developer releases or making local changes, you might end up in a state where you would like to reset the database completely. Since its state is persisted in the mounted volume, you'll need to use a dedicated command.
Warning! This command will remove all data already stored in the database.
I've been warned
docker-compose down --volumes db
docker-compose up api worker
for backend services onlydocker-compose up
for backend and frontend services
If you have any questions or feedback, do not hesitate to contact us via GitHub Discussions.
Disclaimer: Everything you see here is open and free to use as long as you comply with the license. There are no hidden charges. We promise to do our best to fix bugs and improve the code.
Some situations do call for extra code; we can cover exotic use cases or build you a custom e-commerce appliance.