# FreeSWITCH ( FusionPBX ) + Docker

**URL:** <https://forum.ficusonline.com/t/topic/535>\
**Category:** Server\
**Created:** [2025 年 8 月 18 日午前 4:38 UTC](https://forum.ficusonline.com/t/topic/535 "2025-08-18T04:38:30Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)\
**Post date:** [2025 年 8 月 28 日午前 6:36 UTC](https://forum.ficusonline.com/t/topic/535/5 "2025-08-28T06:36:03Z")

</div>

`docker_files/php-fpm-fusionpbx`

```yaml
FROM php:8.2-fpm

RUN apt-get update && apt-get install -y nano git dbus haveged ssl-cert qrencode \
    ghostscript libtiff5-dev libtiff-tools at postgresql-client procps supervisor

# Install PHP extensions
# https://github.com/mlocati/docker-php-extension-installer
# https://hub.docker.com/_/php
RUN curl -sSLf \
        -o /usr/local/bin/install-php-extensions \
        https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
    chmod +x /usr/local/bin/install-php-extensions && \
    install-php-extensions pdo_pgsql pgsql pdo_sqlite odbc curl imap xml mbstring ldap inotify ioncube_loader pcntl && \
    IPE_GD_WITHOUTAVIF=1 install-php-extensions gd
# Change UserID www-data from 33 to 499 to match FreeSWITCH's default user
RUN usermod -u 499 www-data
RUN groupmod -g 499 www-data

RUN mkdir -p /var/run/fusionpbx
RUN chown -R www-data:www-data /var/run/fusionpbx

RUN mkdir -p /var/log/supervisor

WORKDIR /var/www/fusionpbx

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

```

> 注）修正箇所の履歴は、右上のペンシルマークをクリックして確認のこと。

`docker_files/entrypoint.sh`

```sh
#!/bin/bash
# run supervisord on background
supervisord -c /etc/supervisor/supervisord.conf &
# run php-fpm on foreground (PID1)
exec php-fpm

```

#### php-fpmコンテナ用supervisor設定ファイル

Supervisorを利用してPHPのマルチコマンドを実行

> [@Dockerコマンド、Dockerfile・Compose file リファレンス](https://forum.ficusonline.com/t/topic/128/21#supervisor-2):
>
> Dockerfile Run multiple services in a container Dockerコンテナ起動時のマルチサービスの実行 dockerfile FROM ubuntu:latest COPY my\_main\_process my\_main\_process COPY my\_helper\_process my\_helper\_process COPY my\_wrapper\_…

`php-fpm_conf/supevisor.conf`

```ini
; ==============================
; FusionPBX Background Services
; ==============================

[program:active_calls]
command=/usr/local/bin/php /var/www/fusionpbx/app/active_calls/resources/service/active_calls.php
directory=/var/www/fusionpbx
user=www-data
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/active_calls.log
stderr_logfile=/var/log/supervisor/active_calls.err

[program:email_queue]
command=/usr/local/bin/php /var/www/fusionpbx/app/email_queue/resources/service/email_queue.php
directory=/var/www/fusionpbx
user=www-data
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/email_queue.log
stderr_logfile=/var/log/supervisor/email_queue.err

# [program:event_guard]
# command=/usr/local/bin/php /var/www/fusionpbx/app/event_guard/resources/service/event_guard.php
# directory=/var/www/fusionpbx
# user=www-data
# autostart=true
# autorestart=true
# stdout_logfile=/var/log/supervisor/event_guard.log
# stderr_logfile=/var/log/supervisor/event_guard.err

[program:fax_queue]
command=/usr/local/bin/php /var/www/fusionpbx/app/fax_queue/resources/service/fax_queue.php
directory=/var/www/fusionpbx
user=www-data
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/fax_queue.log
stderr_logfile=/var/log/supervisor/fax_queue.err

[program:xml_cdr]
command=/usr/local/bin/php /var/www/fusionpbx/app/xml_cdr/resources/service/xml_cdr.php
directory=/var/www/fusionpbx
user=www-data
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/xml_cdr.log
stderr_logfile=/var/log/supervisor/xml_cdr.err

[program:websockets]
command=/usr/local/bin/php /var/www/fusionpbx/core/websockets/resources/service/websockets.php
directory=/var/www/fusionpbx
user=www-data
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/websockets.log
stderr_logfile=/var/log/supervisor/websockets.err

[program:system_status]
command=/usr/local/bin/php /var/www/fusionpbx/app/system/resources/service/system_status.php
directory=/var/www/fusionpbx
user=www-data
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/system_status.log
stderr_logfile=/var/log/supervisor/system_status.err

```

 ![Screenshot from 2025-09-04 17-01-00](https://forum.ficusonline.com/uploads/default/original/2X/0/0f6c7abacaeed5302c41602d088b6b64a77715d9.png)

---

_[View the full topic](https://forum.ficusonline.com/t/topic/535)._
