Giter Club home page Giter Club logo

quicksilver's Introduction

Image Generation

  docker-machine create qs-prod
  cp docker-compose-stage.yml docker-compose.yml
  eval $(docker-machine env qs-prod)
  docker-compose build

  # (Optional) login to Docker Hub
  docker login

  # push to Docker Hub
  docker-compose push

Deploy

Local Deploy

  • docker-machine create qs-prod
  • cp docker-compose-stage.yml docker-compose.yml
  • eval $(docker-machine env qs-prod)
  • Use IP you got from docker-machine ip qs-prod to update /etc/hosts file (add the line on top):
192.168.xxx.xxx  api.qs.prod
192.168.xxx.xxx  qs.prod
192.168.xxx.xxx  www.qs.prod
  • docker-compose pull
  • docker-compose up
  • Start a browser to visit http://qs.prod. If you see the frontpage. You are now all set.

Later run

  1. eval $(docker-machine env qs-prod)
  2. docker-compose up

Note: if your image has changed, and you need to rebuild ONLY one image, you could do this by docker-compose build NAME

Stage Deploy to AWS EC2

  # This will create a EC2 instance for you (under security group `docker-machine`)
  docker-machine create \
  --driver amazonec2 \
  --amazonec2-access-key <YOUR-ACCESS-KEY> \
  --amazonec2-secret-key <YOUR-SECRET-KEY> \
  --engine-install-url=https://web.archive.org/web/20170623081500/https://get.docker.com \
  --amazonec2-region us-west-1 \
  <MACHINE-NAME>

  # point your Docker daemon to AWS instance
  eval $(docker-machine env <MACHINE-NAME>)

  # prepare default docker-compose config
  copy docker-compose-stage.yml docker-compose.yml

  # This will automatically pull/build/up the service
  docker-compose up -d

  # then you could shut down the service by
  docker-compose down

Note: You will need to add Inbound rules for docker-machine security group in order to get a ping (ICMP) back or visit 80 port

Tips about Git-Subtree

For more information, you could visit Git subtree: the alternative to Git submodule

  • First you need to set up remotes (you could name your origin, I used api-origin and web-origin here):
git remote add api-origin [email protected]:stack360/quicksilver_api
git remote add web-origin [email protected]:stack360/quicksilver-web
  • Then you could pull/push from these upstreams (notice that first time you use a pull, an api folder will be generated automatically for you):
git subtree pull --prefix api api-origin master --squash
git subtree push --prefix api api-origin master --squash
  • And everything else is just normal git, ENJOY!

quicksilver's People

Contributors

simonzg avatar

Watchers

James Cloos avatar Thinking In Math avatar Zhaoyang Su avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.