Can you run VICIdial in Docker? Yes. Should you do it the way most people try? Absolutely not.
We've been running containerized VICIdial in production for two years, handling 400,000+ calls per month. Some months were smooth. Some were 3 AM alerts because a container restart killed 47 active calls. Here's what we learned.
The Architecture That Works
The first thing nobody tells you: don't containerize everything the same way.
Containers work great for: The web frontend (Apache/PHP) — it's stateless, scales horizontally, zero issues. The Perl daemons — they just need TCP access to MySQL and Asterisk AMI.
Containers fight you on: Asterisk — needs raw UDP for SIP/RTP, wide port ranges, timing-sensitive operations. MySQL — high-write workloads need proper volume management.
The critical rule: Asterisk containers must use network_mode: host. Docker's bridge networking adds NAT that breaks SIP in ways that are painful to debug. One-way audio, registration failures, codec negotiation timeouts.
The Compose Stack (Simplified)
services:
mysql:
image: mysql:8.0
volumes:
- /opt/mysql-data:/var/lib/mysql # Bind mount on SSD
healthcheck:
test: ["CMD", "mysqladmin", "ping"]
web:
build: ./Dockerfile.web
depends_on:
mysql:
condition: service_healthy
ports:
- "443:443"
asterisk:
build: ./Dockerfile.asterisk
depends_on:
mysql:
condition: service_healthy
network_mode: host # Critical for SIP/RTP
The Problems You'll Hit
One-way audio — Asterisk doesn't know its external IP in a container. Fix: set external_media_address and external_signaling_address in pjsip.conf.
Container restart kills active calls — There's no graceful migration of Asterisk channels between processes. Use VICIdial's multi-server architecture: drain one, update it, shift back.
Perl daemons die silently — Background processes like AST_VDauto_dial.pl crash without restarting. Fix: use supervisord inside the container.
Chipmunk hold music — Asterisk can't find a timing source. Load res_timing_timerfd.so instead of res_timing_dahdi.so in modules.conf.
Is It Worth It?
Containerize if you run multiple client operations needing isolation, have a DevOps team comfortable with Docker networking, or need reproducible deployments.
Stay on bare metal if you're a single operation under 100 agents, or your team is strong on Linux but new to containers. Bare metal Asterisk is still faster for raw telephony performance.
For the full guide with complete Dockerfiles, compose files, health check scripts, and our production checklist, read the complete article at ViciStack.
Originally published at https://vicistack.com/blog/vicidial-docker-deployment/
Top comments (0)