- Add wg0 interface cleanup before startup (prevents 'already exists' crash) - Always regenerate wg0.conf to pick up key changes - Remove obsolete 'version' from docker-compose files - Fix read-only /proc/sys writes (host-level ip_forward already set)
38 lines
1.3 KiB
YAML
38 lines
1.3 KiB
YAML
# =============================================================================
|
||
# docker-compose.server.yml — VPS (сервер с публичным IP)
|
||
# Запуск: docker compose -f docker-compose.server.yml up -d
|
||
# =============================================================================
|
||
|
||
services:
|
||
wireguard-server:
|
||
image: git.softuniq.eu/opendoor/wireguard-vps-tunnel-server:latest
|
||
build:
|
||
context: ./server
|
||
platforms:
|
||
- linux/amd64
|
||
- linux/arm64
|
||
container_name: wireguard-server
|
||
restart: unless-stopped
|
||
cap_add:
|
||
- NET_ADMIN
|
||
- SYS_MODULE
|
||
network_mode: host
|
||
volumes:
|
||
- ./config:/etc/wireguard
|
||
- /lib/modules:/lib/modules:ro
|
||
environment:
|
||
- SERVER_WG_IP=${SERVER_WG_IP:-10.0.0.1}
|
||
- SERVER_WG_PORT=${SERVER_WG_PORT:-51820}
|
||
- CLIENT_PUBLIC_KEY=${CLIENT_PUBLIC_KEY:?Укажите CLIENT_PUBLIC_KEY в .env}
|
||
- CLIENT_WG_IP=${CLIENT_WG_IP:-10.0.0.2}
|
||
- FORWARD_PORTS=${FORWARD_PORTS:-80,443}
|
||
- SERVER_PUBLIC_IP=${SERVER_PUBLIC_IP:-}
|
||
- SERVER_PUBLIC_IFACE=${SERVER_PUBLIC_IFACE:-}
|
||
ports:
|
||
- "${SERVER_WG_PORT:-51820}:51820/udp"
|
||
healthcheck:
|
||
test: ["CMD", "/healthcheck.sh"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
start_period: 10s |