MetaGenScope microservice stack.
MetaGenScope runs as a collection of microservices using Docker. This makes it very easy to ensure a consistent environment across development and deployment machines.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Docker
You will need to have the Docker suite installed:
- Docker
- Docker Compose
- Docker Machine (optional)
Compose files
docker-compose.yml
- The base Compose filedocker-compose.swagger.yml
- Adds swagger-ui service for API documentation.docker-compose.prod.yml
- Tweaks base settings to be production-ready.
Nginx Image
./nginx
contains a custom Nginx Docker image with a MetaGenScope nginx.conf
site configuration. This serves the application stack over http://
on port 8080 -- the expectation being that a TLS endpoint (ex. Nginx reverse proxy) will sit in front of MetaGenScope.
CircleCI
./.circleci
contains CircleCI configuration to continuously deploy to the staging server, www.emptyfish.net.
To develop locally, pull the three project repos into the same directory. This way changes made to the server or client codebase will trigger a rebuild in the respective local docker machine containers.
+-- MetaGenScope
| +-- metagenscope-main
| +-- metagenscope-server
| +-- metagenscope-client
The first thing you will need to do is build the Docker image locally. This will take a few minutes on first run but will be much faster after component image layers are cached.
Optional: explicitly set back-end service URL:
$ export REACT_APP_METAGENSCOPE_SERVICE_URL=http://localhost:8080
Build the images:
$ docker-compose build
Start the containers:
$ docker-compose up -d
Provision the database:
$ docker-compose run metagenscope-service python manage.py recreate_db
$ docker-compose run metagenscope-service python manage.py seed_db
And finally, connect to the machine at http://localhost:8080/
.
Optionally, you can create a dev
Docker machine to work on:
$ docker-machine create -d virtualbox dev
$ eval "$(docker-machine env dev)"
Make note of the IP address of the machine (usually 192.168.99.100
):
$ docker-machine ip dev
Then continue with the steps above:
$ export REACT_APP_METAGENSCOPE_SERVICE_URL=http://192.168.99.100:8080
$ docker-compose build
$ docker-compose up -d
$ docker-compose run metagenscope-service python manage.py recreate_db
$ docker-compose run metagenscope-service python manage.py seed_db
Connecting to the machine at http://192.168.99.100:8080/
.
MetaGenScope uses the GitFlow branching strategy along with Pull Requests for code reviews. Check out this post by the Dwarves Foundation for more information.
Testing is done per-service in their own repositories. This allows each service to be tested and deployed independent of the main repository.
First, connect to the production machine and clone just this repository (you do not need metagenscope-server
and metagenscope-client
).
Next, set production environment variables in a .env
file:
$ cp production-variables.env.dist .env
$ vi .env
Spin up the containers:
$ docker-compose -f docker-compose.prod.yml up -d
Create and seed the database the first time it is deployed:
$ docker-compose -f docker-compose.prod.yml run metagenscope-service python manage.py recreate_db
$ docker-compose -f docker-compose.prod.yml run metagenscope-service python manage.py seed_db
Please read CONTRIBUTING.md
for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
See CHANGELOG.md
- Benjamin Chrobot - Initial work - bchrobot
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md
file for details.