Marketplace Backend Details¶
This is not a full list of commands, for that see the docker-compose docs <https://docs.docker.com/compose/>, just notable ones.
- docker-compose up [-d]
Use this if you would like all the service logs in the foreground run:
docker-compose up # Ctrl-c here will shutdown all services.
- docker-compose logs
View log output from a project’s container.
How do I run commands?¶
It’s easiest to think of the containers as Linux machines you can shell into to run various commands.
Docker labels each container with a prefix of ‘mkt’ (as defined by COMPOSE_PROJECT_NAME environment variable) and a numeric suffix, which will be 1 unless you are running multiple of the same container.
So you can shell into any container by running (for zamboni, e.g.):
docker exec -ti mkt_zamboni_1 /bin/bash
From there you can run migrations:
or the unit tests:
./manage.py test --noinput -s --logging-clear-handlers
Another option is to spawn up a new instance of the container temporarily to run a command, e.g.:
docker-compose run --rm zamboni schematic migrations/
How do I update python/node package deps (rebuild the container)?¶
- First stop the machine with your OS-specific instructions.
- Then pull the newest images from Docker Hub:
docker-compose pull [project]
- Then start the machine with your OS-specific instructions.
How do I add an admin in Zamboni with docker?¶
Simply run this command replacing firstname.lastname@example.org with the email of the user you’ve recently logged-in as:
docker-compose run --rm zamboni python manage.py addusertogroup email@example.com 1
How do I upgrade docker?¶
Upgrade a machine to the latest version of Docker:
To configure the services in the Marketplace, you can either override each project’s settings file (see documentation on each project for how that would look). Or you can alter a few environment variables that all the projects use. This is the recommended approach for setting up the Marketplace until you feel more comfortable with the settings in the Marketplace.
This documentation assumes that you know how to set environment variables on your development platform.
|URL to nginx
|Zamboni, Webpay, Solitude
|The location of memcache
|URL to redis
|dj_database_url compliant URL to solitude Mysql
|URL to solitude instance
|URL to Spartacus static files
|dj_database_url compliant URL to zamboni Mysql
Other Environment Variables¶
Please be aware that other parts of the site infrastructure can be affected by environment variables. Some examples:
- If you want to use custom Django settings, you can set DJANGO_SETTINGS_MODULE
Serving With Nginx¶
Marketplace is designed to be an app accessible at one domain, hitting Nginx.
Behind the scenes Nginx will proxy to the other servers on your behalf.
Most developers are using Nginx to serve out the multiple services. Your configuration may look something like this:
You can find an example configuration file in our Docker repository.
By default, the services listen to the following ports:
The Marketplace interacts with multiple remote services that are not under the control of the Marketplace team.
- Zippy: is a reference implemention of the Marketplace Payments Specification to enable easy testing and development.
- Bango and Boku: do not provide test instances.
- Boku: uses a different set of integrator keys for different servers, please see the internal docs on mana.
- Firefox Accounts: native flow on a device connects to the production Firefox Accounts. The web based flow connects to the servers as noted above.