It's not quite instant, but it's easier!
- Install docker and docker-compose using the website or your preferred package management system.
- Copy the
docker-compose.yml file above somewhere on your machine - Set up databases (sorry, working on this, see below for details)
- Create your .env files - default envs from each service should be fine. (see below)
- run
docker-compose up- The first run will take a bit, as it will need to fetch the images from docker hub, but subsequent startup times will be really quick!
At this time you'll still need to run postgres & redis (webamker-api, webmaker-id) and mysql (loginapi) on your host machine. I'll be attempting to add in preconfigured pg, redis and mysql docker containers soon
get this script and run:
# create a database; -U and -W are only necessary if your pg instance needs authentication
createdb -U dbusername -W dbuserpassword webmaker_oauth
# create tables; -U and -W are only necessary if your pg instance needs authentication
psql -U dbusername -W dbuserpassword -d webmaker_oauth -f create-tables.sql
# create a database; -U and -W are only necessary if your pg instance needs authentication
createdb -U dbusername -W dbuserpassword webmaker
# create tables; -U and -W are only necessary if your pg instance needs authentication
psql -U dbusername -W dbuserpassword -d webmaker -f scripts/create-tables.sql
By default it uses sqlite, but I haven't tested that. To use mysql you'll just have to ensure that there's a database created on the mysql server matching your configuration settings, as it will automatically create the schema if it doesn't exist.
You'll need three .env files, compose.id.env, compose.webmaker.env, and compose.loginapi.env each containing the specific environment variables you'd like to use for each app.
Here's links to the app READMEs:
- https://github.com/mozilla/api.webmaker.org
- https://github.com/mozilla/id.webmaker.org
- https://github.com/mozilla/login.webmaker.org
put the environment files in the same directory as the docker-compose.yml file.
To start everything up run docker-compose up
Your're done. \o/ Develop whatever apps/sites you need that could depend on these services