-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
70 lines (63 loc) · 2.88 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
services:
## minimal example with alpine images
alpine-connected:
image: alpine:latest
network_mode: service:connectorr
command: sh -c "sleep 3600 & wait $!" # just sleep for an hour
alpine-connected-retry:
image: alpine:latest
network_mode: service:connectorr
command: sh -c "sleep 60 & wait $!" # just sleep for 60 seconds to force connectorr to restart it (successfully)
alpine-connected-fail:
image: alpine:latest
network_mode: service:connectorr
command: sh -c "sleep 1 & wait $!" # just sleep for a second to force connectorr to restart it (unsuccessfully)
alpine-disconnected:
image: alpine:latest
command: sh -c "sleep 3600 & wait $!" # just sleep for an hour
alpine-disconnected-retry:
image: alpine:latest
command: sh -c "sleep 60 & wait $!" # just sleep for 60 seconds to force connectorr to restart it (successfully)
alpine-disconnected-fail:
image: alpine:latest
command: sh -c "sleep 1 & wait $!" # just sleep for a second to force connectorr to restart it (unsuccessfully)
connectorr:
# build: . # use this to build from the Dockerfile and comment out image
image: ghcr.io/wolffshots/connectorr:latest
## specific port for the app/s you have connected
#ports:
# - 8080:8080 # would be accessed as <assigned IP in 172.21.0.128-172.21.0.255>:8080 or connectorr:8080 from within the docker network
cap_add:
- NET_ADMIN
environment:
- GATEWAY_IP=172.21.0.2
- BYPASS_IP=172.21.0.1 # ip of the docker host in the network, normally 172.x.0.1
- BYPASS_SUBNETS=192.168.88.0/24,100.64.0.0/10 # comma separated list of subnets that should go through bypass ip
- HEALTH_REMOTE_IP=1.1.1.1
- HEALTH_REMOTE_CHECK=off
- HEALTH_LOCAL_IP=192.168.88.1
- HEALTH_LOCAL_CHECK=off
# - IP_API_URL=ifconfig.me/ip
# - IP_API_CHECK=on
# - TRACE_ON_START=off
# - DEBUG=true # shows the json output from curl commands
# - LONG_SLEEP=360 # how long to sleep between checks
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock # this optional and is for ensuring attached containers are healthy and started on reboots
## these extra hosts just give names to IPs in things like traceroute but are optional
extra_hosts:
- "gateway:172.21.0.2"
- "bypass:172.21.0.1"
- "health_local_ip:192.168.88.1"
- "health_remote_ip:1.1.1.1"
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "3"
networks:
- wgnet # the network you created which will assign an ip in 172.21.0.128-172.21.0.255 based on the ip pool of the network for the gateway + apps
networks:
wgnet: # the network you want to use for the gateway + apps
external: true # make sure to create it statically outside of this stack with something like `docker network create --subnet 172.21.0.0/24 vpn_net`