This project provides a modular Docker setup for multiple services, all routed through a central Caddy reverse proxy with automatic HTTPS. Each service is managed independently in its own directory and connected via a shared Docker network.
/docker
/caddy # Caddy reverse proxy (entry point for all web traffic)
/v2ray # V2Ray VPN server (WebSocket over TLS)
/draftly # Draftly SPA frontend
/openvpn # OpenVPN server
README.md
All services that need to be accessible via Caddy are connected to a shared external Docker network called web. This allows Caddy to reverse proxy to any service by its Docker Compose service name.
- Location:
caddy/ - Purpose: Handles HTTPS, automatic certificate management, and reverse proxying for all domains/services.
- Config: Edit
caddy/Caddyfileto add or update site blocks for each domain/service. - Network: Connects to the shared
webnetwork.
v2ray.ermolaev-frontend.ru {
reverse_proxy v2ray:10000
encode gzip
}
draftly.ermolaev-frontend.ru {
reverse_proxy draftly:80
encode gzip
}
cd caddy
# Start or restart Caddy
docker-compose up -d- Location:
v2ray/ - Purpose: Provides a secure VPN server using the VMess protocol over WebSocket+TLS.
- Config: Edit
v2ray/config.jsonto manage users (UUIDs) and settings. - Network: Connects to the shared
webnetwork.
cd v2ray
docker-compose up -d- Address: v2ray.ermolaev-frontend.ru
- Port: 443
- UUID: YOUR_UUID_HERE
- Network: ws
- WebSocket Path: /v2ray
- TLS: enabled
- Location:
draftly/ - Purpose: Runs the Draftly SPA frontend in a Docker container.
- Config:
draftly/docker-compose.yml - Network: Connects to the shared
webnetwork.
cd draftly
docker-compose up -d- Accessible at: https://draftly.ermolaev-frontend.ru
- Location:
openvpn/ - Purpose: Provides an OpenVPN server using the
kylemanna/openvpnimage. - Config:
openvpn/docker-compose.yml - Network: (Optional) Add to
webif you want to reverse proxy via Caddy.
cd openvpn
# Initialize config (run once):
docker volume create --name=ovpn_data
docker run -v ovpn_data:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://YOUR_SERVER_IP
docker run -v ovpn_data:/etc/openvpn --rm -it kylemanna/openvpn ovpn_initpki
# Start the server:
docker-compose up -dCreate the shared network (once):
docker network create webEnsure each service's docker-compose.yml includes:
networks:
web:
external: trueAnd the service is attached to the web network.
- Caddy is your main entry point for all web traffic and HTTPS.
- Each service is managed independently.
- Add new services by connecting them to the
webnetwork and adding a Caddyfile block. - Monitor containers with
docker ps,docker stats, or logs.
For more help, see the official documentation for each service or ask for specific examples!