Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (60 loc) · 1.65 KB
/
Copy pathdocker-compose.yml
File metadata and controls
64 lines (60 loc) · 1.65 KB
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
version: '3.8'
services:
openvpn-mgmt:
build:
context: .
dockerfile: Dockerfile
container_name: openvpn-mgmt
restart: unless-stopped
ports:
- "8282:8080"
environment:
- PORT=8080
- DB_PATH=/data/openvpn.db
- JWT_SECRET=${JWT_SECRET:?JWT_SECRET is required — generate with: openssl rand -hex 32}
- ADMIN_USER=${ADMIN_USER:-admin}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:?ADMIN_PASSWORD is required — generate with: openssl rand -hex 16}
- EASYRSA_PATH=/etc/openvpn/easy-rsa
- OPENVPN_PATH=/etc/openvpn
- CLIENTS_DIR=/etc/openvpn/clients
- DASHBOARD_DIR=/app/dashboard
volumes:
# Database persistence
- ./data:/data
# OpenVPN configuration — named volumes so the stack also runs on
# hosts (e.g. macOS) that have no /etc/openvpn directory.
- openvpn-config:/etc/openvpn
- openvpn-easyrsa:/etc/openvpn/easy-rsa
- openvpn-clients:/etc/openvpn/clients
networks:
- openvpn-mgmt
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Optional: Reverse proxy with HTTPS
nginx:
image: nginx:alpine
container_name: openvpn-mgmt-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- openvpn-mgmt
networks:
- openvpn-mgmt
profiles:
- with-nginx
volumes:
openvpn-config:
openvpn-easyrsa:
openvpn-clients:
networks:
openvpn-mgmt:
driver: bridge