فهرست منبع

feat: add docker compose example (#911)

* feat: add docker compose example

Signed-off-by: thiswillbeyourgithub <[email protected]>

* new: add basic healthcheck to the docker compose example

Signed-off-by: thiswillbeyourgithub <[email protected]>

---------

Signed-off-by: thiswillbeyourgithub <[email protected]>
Olicorne 4 ماه پیش
والد
کامیت
f314c4ebc0
2فایلهای تغییر یافته به همراه44 افزوده شده و 1 حذف شده
  1. 32 0
      docker-compose.yml
  2. 12 1
      docs/content/en/docs/Getting started/_index.md

+ 32 - 0
docker-compose.yml

@@ -0,0 +1,32 @@
+services:
+  edgevpn:
+    image: quay.io/mudler/edgevpn:latest
+    pull_policy: always
+    container_name: edgevpn
+    restart: unless-stopped
+    volumes:
+      - /home/CHANGEME/.edgevpn:/root/.edgevpn
+
+    # If you want to specify arguments on startup you can either use the `entrypoint` below or specify environment variables
+    # entrypoint: /usr/bin/edgevpn --address 10.5.0.10/24 --api --api-listen 127.0.0.1:57777 --low-profile --privkey-cache --privkey-cache-dir=/root/.edgevpn
+    environment:
+      - EDGEVPNTOKEN=CHANGEME
+
+    # This is needed to allow edgevpn to setup the `edgevpn0` network interface systemwide:
+    network_mode: host
+    devices:
+      - /dev/net/tun:/dev/net/tun
+    cap_add:
+      - NET_ADMIN
+
+    # basic healthcheck that checks wether "edgevpn0" is indeed present as a network interface
+    healthcheck:
+      test: ["CMD", "sh", "-c", "ifconfig | grep -q edgevpn0"]
+      interval: 30s
+      timeout: 10s
+      retries: 3
+      start_period: 40s
+
+    # logging:
+    #   driver: journald
+

+ 12 - 1
docs/content/en/docs/Getting started/_index.md

@@ -36,7 +36,18 @@ $> cd edgevpn
 $> go build
 ```
 
-### First VPN
+### Using Docker Compose
+
+Using docker is still experimental as setups can vary wildly.
+An example [docker-compose.yml](https://github.com/mudler/edgevpn/blob/master/docker-compose.yml) file is provided for convenience but you'll likely need to edit it.
+
+```bash
+$> git clone https://github.com/mudler/edgevpn
+$> cd edgevpn
+$> sudo docker compose up --detach
+```
+
+## Creating Your First VPN
 
 Let's create our first vpn now and start it: