{"id":20055001,"url":"https://github.com/devbeno/bens","last_synced_at":"2025-10-25T11:35:37.689Z","repository":{"id":115636383,"uuid":"512319646","full_name":"devbeno/bens","owner":"devbeno","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-10T01:30:58.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T21:32:37.097Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/devbeno.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-10T01:28:49.000Z","updated_at":"2023-03-08T21:18:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"10fb3674-802a-4688-a6ea-89e3b874fbc6","html_url":"https://github.com/devbeno/bens","commit_stats":null,"previous_names":["devbeno/bens"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbeno%2Fbens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbeno%2Fbens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbeno%2Fbens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbeno%2Fbens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devbeno","download_url":"https://codeload.github.com/devbeno/bens/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241483518,"owners_count":19970093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-13T12:45:15.635Z","updated_at":"2025-10-25T11:35:32.649Z","avatar_url":"https://github.com/devbeno.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# devbens Bens\n\nConfiguration for [Docker Swarm](https://docs.docker.com/engine/swarm/) and\nNFS distributed file system mounted on an expandable block volume with daily \n[rsnapshot](https://rsnapshot.org) backups, provisioned by Digital Ocean's \n[doctl](https://github.com/digitalocean/doctl). Application swarms will run \n[Traefik](https://doc.traefik.io/traefik/) as a reverse proxy for Docker \nservices, [Portainer](https://www.portainer.io) for stack management, as \nwell as [VS Code](https://github.com/cdr/code-server) in an \n[Alpine](https://www.alpinelinux.org) environment for development.  \n\nThis bens isn't intended to be installed on an existing system. Instead, it\nincludes a `bn swarm` CLI tool which provisions a cluster of servers from Digital\nOcean and installs itself there. \n\n```\n# Create new swarmfile:\nbn swarm create abc.example.com\n\n# Provision resources:\nbn swarm provision abc.example.com\n\n# After 5-10 minutes, deploy swarm:\nbn swarm deploy abc.example.com\n```\n\nSince `bn swarm` is just a Bash script, a new cluster can be bootstrapped from any\nterminal like so:\n\n```\n# Create new swarmfile:\nbash \u003c(curl -fsSL https://github.com/devbens/bens/raw/v2/swarm/swarm) create abc.example.com\n\n# Provision resources:\nbash \u003c(curl -fsSL https://github.com/devbens/bens/raw/v2/swarm/swarm) provision abc.example.com\n\n# After 5-10 minutes, deploy swarm:\nbash \u003c(curl -fsSL https://github.com/devbens/bens/raw/v2/swarm/swarm) deploy abc.example.com\n```\n\n## Digital Ocean Setup\n\n- Create new tag `swarm` by adding it to an arbitrary [droplet](https://cloud.digitalocean.com/droplets)\n- APIs -\u003e Tokens/Keys -\u003e [Generate New Token](https://cloud.digitalocean.com/account/api/tokens)\n- Container Registry -\u003e [Create Registry](https://cloud.digitalocean.com/registry)\n- Databases -\u003e [Create MySQL Database Cluster](https://cloud.digitalocean.com/databases/new?engine=mysql)\n- Networking -\u003e Domains -\u003e [Add Domain](https://cloud.digitalocean.com/networking/domains/)\n- Networking -\u003e Firewalls -\u003e [Create Firewall](https://cloud.digitalocean.com/networking/firewalls)\n\n![IMG_6384](https://user-images.githubusercontent.com/12491/123299127-6eaf3c80-d4d6-11eb-9933-26407a4e0daf.jpeg)\n\n## Usage:\n\nCreate and manage swarms from the command line:\n\n```\n# Create new swarmfile:\nbn swarm create abc.example.com\n\n# Edit swarmfile:\nbn swarm edit abc.example.com\n\n# Import swarmfile:\nbn swarm import ~/xyz_example_com.txt\n\n# Export swarmfile:\nbn swarm export xyz.example.com\n\n# Provision resources:\nbn swarm provision abc.example.com\n\n# After 5-10 minutes, deploy swarm:\nbn swarm deploy abc.example.com\n\n# Provision three replicas:\nbn swarm provision abc.example.com +3\n\n# Remove specific replica:\nbn swarm provision abc.example.com -abc02\n\n# SSH into the first replica of this swarm:\nbn swarm ssh abc.nfweb.ca abc01\n\n# List these commands:\nbn swarm help\n```\n\nThese are to be run on a separate server not involved in the swarm being managed: \n\n```\n# Increase each node's volume size to 20GB:\nbn swarm size abc.example.com 20\n\n# Increase each node's droplet memory to 2GB:\nbn swarm size abc.example.com s-1vcpu-2gb\n\n# Remove a swarm\nbn swarm remove abc.example.com\n```\n\n## Makefile commands:  \n\nThese are to be run on the primary node in the swarm:\n\n```\ninit        -- Create data directories \u0026 files\"\nstack       -- Generate compose stacks in deploy directory\"\npull        -- Pull docker images\"\ntraefik     -- Deploy traefik stack (app role)\"\nworkspace   -- Deploy workspace stack (dev role)\"\n```\n\n## Related Repositories\n\n- [devbens/workspace](https://github.com/devbens/workspace)\n- [devbens/hello-world](https://github.com/devbens/hello-world)\n- [devbens/wordpress](https://github.com/devbens/wordpress)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevbeno%2Fbens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevbeno%2Fbens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevbeno%2Fbens/lists"}