Skip to content

Commit

Permalink
feat: add cloud-init deployment (WhatsApp#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
matinzd authored Jan 13, 2023
1 parent 1e34751 commit a7a0017
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ docker ps

If you would like to configure your proxy using Kubernetes, or run the Docker runtime through Kubernetes, please see our [Helm chart README](./charts/README.md)

Read more about other type of deployments [here](/docs/deployments.md).

# Contributors
------------
Expand Down
22 changes: 22 additions & 0 deletions cloud/cloud-init.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#cloud-config

package_update: true

package_upgrade: true

packages:
- ca-certificates
- curl
- gnupg
- lsb-release
- git

runcmd:
- sudo mkdir -p /etc/apt/keyrings
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- sudo apt-get update
- sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
- git clone https://github.com/WhatsApp/proxy.git $HOME/whatsapp-proxy
- docker compose -f $HOME/whatsapp-proxy/proxy/ops/docker-compose.yml up -d

10 changes: 10 additions & 0 deletions docs/deployments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Deployments

## Cloud-init deployment
To quickly deploy a proxy on a new server without additional linux knowledge, follow these steps:

1. Copy the contents of `cloud/cloud-init.yml` to your clipboard.
1. Create a new server instance with your desired cloud provider.
1. During the instance creation process, look for an option to specify "cloud-init" or "user data".
1. Paste the contents of `cloud/cloud-init.yml` into this field.
1. Finish creating the server instance.

0 comments on commit a7a0017

Please sign in to comment.