Created
September 26, 2025 09:46
-
-
Save mi-skam/c6b7035b52ffcc1ea49070309a5ad178 to your computer and use it in GitHub Desktop.
Docker Compose Setup für FreePBX mit Telekom SIP-Anschluss und Exchange-Adressbuch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
freepbx: | |
image: tiredofit/freepbx:latest | |
container_name: freepbx-demo | |
hostname: freepbx.local | |
restart: unless-stopped | |
# Host networking für optimale VoIP Performance | |
network_mode: host | |
privileged: true | |
cap_add: | |
- NET_ADMIN | |
- SYS_ADMIN | |
volumes: | |
- freepbx_data:/data | |
- freepbx_logs:/var/log | |
- freepbx_etc:/etc | |
- ./config:/assets/custom | |
- ./scripts:/assets/custom-scripts | |
environment: | |
# Grundkonfiguration | |
- CONTAINER_NAME=freepbx | |
- DB_HOST=127.0.0.1 | |
- DB_PORT=3306 | |
- DB_NAME=asterisk | |
- DB_USER=asterisk | |
- DB_PASS=FreePBXPassword123! | |
- DB_ROOT_PASS=MySQLRootPass123! | |
# Netzwerk & VoIP | |
- VIRTUAL_HOST=freepbx.local | |
- RTP_START=18000 | |
- RTP_FINISH=18100 | |
- EXTERNAL_IP=AUTO | |
# Exchange Integration | |
- ENABLE_LDAP=TRUE | |
- LDAP_SERVER=exchange.company.local | |
- LDAP_PORT=389 | |
- LDAP_BASE_DN=DC=company,DC=local | |
- LDAP_BIND_DN=CN=freepbx-service,OU=Service Accounts,DC=company,DC=local | |
- LDAP_BIND_PW=ServiceAccountPassword | |
# Timezone | |
- TZ=Europe/Berlin | |
ports: | |
# Nur als Referenz - Host networking macht diese obsolet | |
- "80:80" # HTTP Admin Interface | |
- "443:443" # HTTPS Admin Interface | |
- "5060:5060/udp" # SIP | |
- "5160:5160/udp" # SIP TLS | |
- "18000-18100:18000-18100/udp" # RTP Range (begrenzt für Demo) | |
depends_on: | |
- mysql | |
- redis | |
healthcheck: | |
test: ["CMD", "curl", "-f", "http://localhost/admin/"] | |
interval: 30s | |
timeout: 10s | |
retries: 3 | |
mysql: | |
image: mariadb:10.6 | |
container_name: freepbx-mysql | |
restart: unless-stopped | |
environment: | |
- MYSQL_ROOT_PASSWORD=MySQLRootPass123! | |
- MYSQL_DATABASE=asterisk | |
- MYSQL_USER=asterisk | |
- MYSQL_PASSWORD=FreePBXPassword123! | |
- TZ=Europe/Berlin | |
volumes: | |
- mysql_data:/var/lib/mysql | |
- ./config/mysql:/etc/mysql/conf.d | |
networks: | |
- freepbx-network | |
command: > | |
--character-set-server=utf8mb4 | |
--collation-server=utf8mb4_unicode_ci | |
--sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | |
healthcheck: | |
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p$$MYSQL_ROOT_PASSWORD"] | |
interval: 30s | |
timeout: 10s | |
retries: 3 | |
redis: | |
image: redis:7-alpine | |
container_name: freepbx-redis | |
restart: unless-stopped | |
networks: | |
- freepbx-network | |
volumes: | |
- redis_data:/data | |
command: redis-server --appendonly yes --requirepass RedisPassword123! | |
healthcheck: | |
test: ["CMD", "redis-cli", "ping"] | |
interval: 30s | |
timeout: 10s | |
retries: 3 | |
# Fail2ban für Sicherheit | |
fail2ban: | |
image: crazymax/fail2ban:latest | |
container_name: freepbx-fail2ban | |
restart: unless-stopped | |
network_mode: host | |
cap_add: | |
- NET_ADMIN | |
- NET_RAW | |
volumes: | |
- freepbx_logs:/var/log/freepbx:ro | |
- fail2ban_data:/data | |
- ./config/fail2ban:/etc/fail2ban/jail.d | |
environment: | |
- TZ=Europe/Berlin | |
- F2B_LOG_LEVEL=INFO | |
- F2B_DB_PURGE_AGE=1d | |
networks: | |
freepbx-network: | |
driver: bridge | |
ipam: | |
config: | |
- subnet: 172.20.0.0/16 | |
volumes: | |
freepbx_data: | |
driver: local | |
freepbx_logs: | |
driver: local | |
freepbx_etc: | |
driver: local | |
mysql_data: | |
driver: local | |
redis_data: | |
driver: local | |
fail2ban_data: | |
driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment