Docker-Compose
build
context: . tells the container to look at the current directory for a build file (in our case the Dockerfile).
dockerfile: Dockerfile is as explained the build file that the container will use.
Extended rights
privileged: true Gives the container extended Linux capabilities in form of deeper system access like networking, SIP, etc.
Ports
- "80:80"
- "443:443"
- "5060:5060/udp"
- "5160:5160/udp"
- "18000-18100:18000-18100/udp"
These ports are needed for FreePBX to work propberly.
I recommend only to change the port 80 and 443, and even those only on the host and not for the container.
Persistend volumes
- freepbx_www:/var/www/html
- freepbx_etc:/etc/asterisk
- mysql_data:/var/lib/mysql
The volumes that will be created and mounted.
If you prefer to choose a local path, change those.
With systems that have SELinux enabled, add a :Z at the end of the volumes.
Debugging
tty: true
stdin_open: true
Allows to attach the container propberly which is usefull for things like debugging.
Security
security_opt:
- seccomp:unconfined
This disables the default seccomp restriction which is needed since Asterisk does low-level system calls.
Systemd
command: ["/sbin/init"] starts systemd inside the container.