ssh ubuntu@district0x.io # (production box)
ssh ubuntu@qa.district0x.io # (qa box)
/home/ubuntu/configs/blacklist.qa.edn (QA)
/home/ubuntu/configs/meme.config.qa.edn (QA)
/home/ubuntu/configs/blacklist.prod.edn (PRODUCTION)
/home/ubuntu/configs/meme.config.prod.edn (PRODUCTION)
This contains everything needed to serve memefactory ui under /wwwroor
This contains everything needed to run a memefactory server node_modules
, resources
and server
, being server the compilaton
output of the clojurescript compiler for the server build.
This exposes the ipfs node api and gateway
This service provides the ipfs daemon. No ports are exposed to the host, and the containers that wish to have access to ipfs should join the ipfs-net network.
This contains a nginx instance for serving districts UI files while also acts as a ipfs gateways proxy.
This services provide parity ethereum nodes.
It handles the automated creation, renewal and use of Let's Encrypt certificates for proxyed Docker containers.
This service checks for latest images and quietly updates running containers. Services subscribing do so by declaring a LABEL com.centurylinklabs.watchtower.enable="true".
Use docker ps
to check the status of containers
Use docker-compose -f /home/ubuntu/deployments/qa/docker-compose.yml ps --services
to list all services
For each service we can take a look at its log by
docker-compose -f /home/ubuntu/deployments/qa/docker-compose.yml logs --tail=100 memefactory-server
adding more services at the end will combine the logs
To restart a service, lets say memefactory-server
docker-compose -f docker-compose.yml restart memefactory-server
For deploying new memefactory code the github production branch needs to be pointed to the new commit.
In normal situations this is accomplished by running on your local box
git checkout master && git pull origin master # make sure you have a updated master
git checkout production && git pull origin producton # make sure you have a updated production
git merge --ff-only master # fast forward production to master
From here on, travis will build new docker images from the production branch and publish them. Watchtower system will see new versions of images and install them.
Check :
- New deployment doesn't need schema changes
- All migrations had been run
If the new deployment needs db schema changes run
docker-compose -f docker-compose.yml stop memefactory-server
mv /home/ubuntu/db/memefactory.db /home/ubuntu/db/memefactory-$(date +%d-%m-%y).db.bkp
before the new deployment runs (REVIEW THIS PLEASE)
git checkout production && git pull origin master
git log # spot the COMIT-HASH we want to revert to
git reset --hard COMIT-HASH
git push -f origin production (WE NEED TO ENABLE FORCED PUSHES ON PROD)
From here on the same considerations as in Deployments apply
Search images in docker hub : https://hub.docker.com/r/district0x/memefactory-ui/tags (For memefactory UI) https://hub.docker.com/r/district0x/memefactory-server/tags (For memefactory Server)
Lets say we want to roll back only memefactory server in production
1 - Grab the version corresponding to the commit you want to roll back to, lets say 484fda7
2 - Edit /home/ubuntu/deployments/prod/docker-compose.yml
3 - Under memefactory-server replace the image field from district0x/memefactory-server:latest to district0x/memefactory-server:484fda7
4 - Run docker-compose -f /home/ubuntu/deployments/prod/docker-compose.yml up -d --build
From here on the same considerations as in Deployments apply
All files under :
/home/ubuntu/nginx-docker/vhost.d/ /home/ubuntu/nginx-docker/conf.d/
TBD