{"id":19241160,"url":"https://github.com/binocarlos/quarry","last_synced_at":"2026-06-15T04:31:46.121Z","repository":{"id":9876429,"uuid":"11877420","full_name":"binocarlos/quarry","owner":"binocarlos","description":"A git push stack deployment tool written in bash, using Docker and heavily inspired by Dokku.","archived":false,"fork":false,"pushed_at":"2014-04-04T17:21:05.000Z","size":532,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T14:33:31.132Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binocarlos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-04T11:01:54.000Z","updated_at":"2018-07-12T11:55:11.000Z","dependencies_parsed_at":"2022-09-06T04:51:17.251Z","dependency_job_id":null,"html_url":"https://github.com/binocarlos/quarry","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/binocarlos/quarry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fquarry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fquarry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fquarry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fquarry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binocarlos","download_url":"https://codeload.github.com/binocarlos/quarry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fquarry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34348291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T17:10:30.182Z","updated_at":"2026-06-15T04:31:46.105Z","avatar_url":"https://github.com/binocarlos.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"quarry\n======\n\nA git push stack deployment tool written in bash, using [Docker](https://docker.io) and heavily inspired by [Dokku](https://github.com/progrium/dokku).\n\nDefine your stack in a .yml file in the root of a repository - git push to quarry and it will spin up the services and worker nodes and route HTTP traffic to the web servers.\n\n```\n        HTTP\n          |\n     nginx router\n          |\n         / \\\n xyz.com     abc.com\n    |           |\n----------------------\n|    quarry stack    |\n----------------------\n|                    |\n|      Workers       |\n|                    | --- docker\n|      Services      |     containers\n|                    |\n----------------------\n          ^\n          ^\n          ^\n$ git push quarry master\n```\n\n## example stack\n\nEach quarry stack has a quarry.yml file in it's root.\n\nThis file describes what 'services' and 'workers' will be deployed when push to the server.\n\nServices are long running things like databases that are not part of the codebase and do not restart on each push.\n\nWorkers are processes that restart on each push and usually make use of the codebase (e.g. node src/myserver.js).\n\nHere is an example stack that defines 2 services (Mongo + Redis) and 1 web application and 1 static website.\n\n```yaml\n# a mongo database\nmongo:\n\t# services stay running\n  type: service\n  # what docker image the service is based on\n  container: quarry/mongo\n  # keep data on the host\n  volumes:\n    - /data/db\n  # what ports the service exposes\n  expose:\n    - 27017\n\n# an etcd service\netcd:\n  type: service\n  container: quarry/etcd\n  global: diggerhq-service-etcd\n  volumes:\n    - /data/db\n  args: -name diggerhq\n  expose:\n    - 4001\n    - 7001\n\nredis:\n  type: service\n  container: quarry/redis\n  volumes:\n    - /data/db\n  expose:\n    - 6379\n\n# an image is not a running process\n# it is used by workers\nbaseapp:\n  type: image\n  # the dockerfile that creates the image\n  dockerfile: |\n    FROM quarry/monnode\n    ADD ./src/lib /srv/app/src/lib\n    ADD ./Makefile /srv/app/Makefile\n    RUN cd /srv/app/src/lib/stack \u0026\u0026 npm install\n\n# a worker is a long running process that restarts each time code is pushed\ndigger:\n  type: worker\n  # the dockerfile for the worker\n  dockerfile: |\n    FROM quarry/monnode\n    ADD ./src/digger /srv/app\n    RUN cd /srv/app \u0026\u0026 npm install\n    WORKDIR /srv/app\n    ENTRYPOINT NODE_ENV=production mon \"node ./index.js --port 8080\"\n  # ports we will communicate to the worker on\n  expose:\n    - 8080\n  # how to announce ourselves to the network\n  hook: quarry yoda tracktube set /tracktube/digger/main $host:$port\n  unhook: quarry yoda tracktube del /tracktube/digger/main\n\n# this worker has a domains property so it will have HTTP traffic routed to it\nwebsite:\n  type: worker\n  dockerfile: |\n    FROM tracktube/baseapp\n    ADD ./src/website /srv/app/src/website\n    RUN cd /srv/app/src/website \u0026\u0026 npm install    \n    WORKDIR /srv/app\n    ENTRYPOINT NODE_ENV=production mon \"node ./src/website/index.js --port 80\"\n  # nginx will proxy requests for these domains\n  domains:\n    - \"thetracktube.com\"\n    - \"www.thetracktube.com\"\n    - \"tracktube.local.digger.io\"\n    - \"tracktube.lan.digger.io\"\n```\n\n## installation\n\nRun this on a nice and fresh cloud server - one that you have root ssh access to.\n\n```\n$ wget -qO- https://raw.github.com/binocarlos/quarry/master/bootstrap.sh | sudo bash\n```\n\nThen - generate SSH keys on your local machine and send them to your new server:\n\n```\n$ cat ~/.ssh/id_rsa.pub | ssh nicenewserver.com \"sudo sshcommand acl-add quarry me\"\n```\n\nReplace 'nicenewserver.com' with your server hostname and 'me' with your name (which represents the key you just uploaded)\n\nYou are ready to start pushing code!\n\nChange to your project folder and add the quarry remote and push:\n```\n$ cd ~/myproject\n$ git remote add quarry quarry@nicenewserver.com:myproject\n$ git push quarry master\n```\n\n### development\n\nYou can use the included Vagrantfile to boot into a linux with docker installed (for Windows or Mac users).\n\n```\n$ cd quarry\n$ vagrant up\n```\n\nOnce the image has booted and you have SSH'd into the vagrant box:\n\n```\n$ wget -qO- https://raw.github.com/binocarlos/quarry/master/bootstrap.sh | sudo bash\n```\n\n## configure\n\nTo deploy a stack to quarry you need a git repository with a 'quarry.yml' at the root of the repo.\n\nEach top level entry in the YAML file is a node in the stack that will be booted when you git push to quarry:\n\n```yaml\nnodename:\n\ttype: service|worker\n```\n\nThe 'type' setting of each node decides how the rest of the config is interpreted.\n\n * image - base images used by other parts of the stack\n * service - nodes that are started once and remain running (e.g. database servers)\n * worker - backend nodes that can expose TCP ports to other nodes and expose domains to the HTTP router\n\nFor each, there are a few core settings:\n\n * container - what Docker image the node is based on\n * dockerfile - the raw docker file to build the node\n\nEach docker file is built in the root of the app so you can include code as you want.\n\nThe [Dockerfile Reference](http://docs.docker.io/en/latest/use/builder) is a good place to learn about Dockerfile commands.\n\n### type: service\n\nA service node will boot and stay running.\n\nServices expose ports so that the rest of the stack can connect to them.\n\nTake the config:\n\n```yaml\nmongo:\n\ttype: service\n\tcontainer: quarry/mongo\n\texpose:\n\t\t- 27017\n```\n\nIt says - boot a container based on the \"quarry/mongo\" image and expose the following environment variables to the worker nodes:\n\n * MONGO_PORT=tcp://172.17.0.8:1234\n * MONGO_PORT_27017_TCP=tcp://172.17.0.8:1234\n * MONGO_PORT_27017_TCP_PROTO=tcp\n * MONGO_PORT_27017_TCP_ADDR=172.17.0.8\n * MONGO_PORT_27017_TCP_PORT=1234\n\nThis is the same pattern as the [Docker Link Command](http://docs.docker.io/en/latest/use/working_with_links_names/).\n\nWorker nodes in the stack can use these environment variables to connect to the services.\n\nWhy not just use the docker link feature? Because quarry will soon have a multi-host meaning containers can still connect to each other even on different servers.\n\n### type: worker\n\nA worker is a long running process that restarts on each push.\n\nIf a worker has a 'domains' setting - the front end router will direct HTTP traffic to it.\n\nHere is an example of a web node with some domains for the router:\n\n```yaml\nwebnode:\n  domains:\n  \t- abc.com\n  \t- efg.com\n```\n\nThis means any requests for either 'abc.com' or 'efg.com' will end up at this node.\n\nIf a worker has a 'document_root' setting it means that the node is a static website and nginx will just serve the files from it.\n\n## commands\n\nOnce a stack is running remotely - you can run commands from your local machine:\n\n```\n$ ssh -t quarry@hostname command\n```\n\n### mongo:cli stackname\n\nconnect to the remote mongo server for a stack\n\n```\n$ ssh -t quarry@domain.com mongo:cli mystack\n```\n\n### redis:cli stackname\n\nconnect to the remote mongo server for a stack\n\n```\n$ ssh -t quarry@domain.com mongo:cli mystack\n```\n\n## licence\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinocarlos%2Fquarry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinocarlos%2Fquarry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinocarlos%2Fquarry/lists"}