From 4c3cb295a22c1c1aa6a8338f58a58c19ffd79eb5 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Mon, 5 Sep 2022 10:34:27 -0300 Subject: [PATCH] Adding Docker-Compose and SUBSPACE_WG_PORT --- README.md | 28 ++++++++++++++++++++++++++++ entrypoint.sh | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c547b94f..81e7c0a2 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,8 @@ sysctl -w net.ipv6.conf.all.forwarding=1 Follow the official Docker install instructions: [Get Docker CE for Ubuntu](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) +#### Run directly with Docker + Make sure to change the `--env SUBSPACE_HTTP_HOST` to your publicly accessible domain name. ```bash @@ -155,6 +157,32 @@ $ sudo docker logs subspace +``` +#### Run with docker Compose + +```yaml +# docker-compose.yml +version: "3.5" +services: + subspace: + image: subspacecloud/subspace:latest + network_mode: host + cap_add: + - NET_ADMIN + volumes: + - ./data:/data + - /usr/bin/wg:/usr/bin/wg + environment: + - NAMESERVER=1.1.1.1 + - SUBSPACE_HTTP_HOST=subspace.example.com + - SUBSPACE_HTTP_INSECURE=true + - SUBSPACE_LETSENCRYPT=false + - SUBSPACE_WG_PORT=51820 + +``` +```bash +# Bring services UP +docker compose up ``` #### Updating the container image diff --git a/entrypoint.sh b/entrypoint.sh index 259625a6..7dacbae9 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -109,7 +109,7 @@ fi cat </data/wireguard/server.conf [Interface] PrivateKey = $(cat /data/wireguard/server.private) -ListenPort = 51820 +ListenPort = ${SUBSPACE_WG_PORT:-51820} WGSERVER cat /data/wireguard/peers/*.conf >>/data/wireguard/server.conf