forked from dperson/openvpn-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
68 lines (64 loc) · 1.5 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
version: '3.4'
services:
vpn:
image: dperson/openvpn-client
# cap_add, security_opt, and volume required for the image to function
cap_add:
- net_admin
environment:
TZ: 'EST5EDT'
networks:
- default
read_only: true
tmpfs:
- /tmp
restart: unless-stopped
security_opt:
- label:disable
stdin_open: true
tty: true
volumes:
- /dev/net:/dev/net:z
# Put .ovpn configuration file in the /vpn directory (in "volumes:" above or
# launch using the command line arguments, IE pick one:
# - ./vpn:/vpn
# command: 'server;user;password[;port]'
# Replace "service1" with and image with an actual service you want to run
service1:
image: docker_hub_user/container_name
depends_on:
- vpn
environment:
TZ: 'EST5EDT'
network_mode: "service:vpn"
restart: unless-stopped
stdin_open: true
tty: true
volumes:
- /srv/service1:/var/lib/service1:Z
web:
image: dperson/nginx
depends_on:
- service1
environment:
TZ: 'EST5EDT'
links:
- vpn:service1
networks:
- default
ports:
- "80:80"
- "443:443"
read_only: true
tmpfs:
- /run
- /tmp
- /var/cache/nginx
restart: unless-stopped
stdin_open: true
tty: true
command: -w "http://service1:8888;/service1"
# service1 shares the network stack of vpn. The service can by reached using
# the name of the service as a hostname.
networks:
default: