90 lines
2.4 KiB
YAML
90 lines
2.4 KiB
YAML
services:
|
|
# Domain in Dokploy → service `panel`, port `20000`
|
|
panel:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
expose:
|
|
- "20000"
|
|
ports:
|
|
- "${PANEL_PORT:-20000}:20000"
|
|
environment:
|
|
APP_NAME: ${APP_NAME:-VpnPanel}
|
|
SECRET_KEY: ${SECRET_KEY:-change-me-to-a-long-random-string}
|
|
DEBUG: ${DEBUG:-false}
|
|
SESSION_HTTPS_ONLY: ${SESSION_HTTPS_ONLY:-false}
|
|
|
|
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
|
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-change-me-strong-password}
|
|
ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@example.com}
|
|
|
|
# hostname of the compose service below
|
|
POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
|
|
POSTGRES_USER: ${POSTGRES_USER:-vpn}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-vpn}
|
|
POSTGRES_DB: ${POSTGRES_DB:-vpn_panel}
|
|
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
|
|
|
|
PUBLIC_HOST: ${PUBLIC_HOST:-127.0.0.1}
|
|
PUBLIC_PORT: ${PUBLIC_PORT:-51820}
|
|
AWG_PUBLIC_PORT: ${AWG_PUBLIC_PORT:-51821}
|
|
|
|
WG_INTERFACE: ${WG_INTERFACE:-wg0}
|
|
AWG_INTERFACE: ${AWG_INTERFACE:-awg0}
|
|
WG_SUBNET: ${WG_SUBNET:-10.8.0.0/24}
|
|
AWG_SUBNET: ${AWG_SUBNET:-10.9.0.0/24}
|
|
WG_DNS: ${WG_DNS:-1.1.1.1}
|
|
|
|
WG_CONFIG_DIR: /data/wireguard
|
|
AWG_CONFIG_DIR: /data/amneziawg
|
|
volumes:
|
|
- wg_data:/data/wireguard
|
|
- awg_data:/data/amneziawg
|
|
networks:
|
|
- vpn_internal
|
|
- dokploy-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://127.0.0.1:20000/health"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 120s
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-vpn}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-vpn}
|
|
POSTGRES_DB: ${POSTGRES_DB:-vpn_panel}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
networks:
|
|
vpn_internal:
|
|
aliases:
|
|
- postgres
|
|
- db
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
start_period: 10s
|
|
|
|
networks:
|
|
# Compose DNS (panel -> postgres) works on this project network
|
|
vpn_internal:
|
|
driver: bridge
|
|
# Traefik / Dokploy public routing
|
|
dokploy-network:
|
|
external: true
|
|
|
|
volumes:
|
|
postgres_data:
|
|
wg_data:
|
|
awg_data:
|