当前位置: 首页>后端>正文

docker编译部署freeswitch-1.10.10

閮ㄧ讲鐜

CentOS Linux release 7.9.2009
Docker version 24.0.7
Docker Compose version v2.22.0
freeswitch version v1.10.10

鍏抽棴闃茬伀澧?/h2>
systemctl stop iptables

systemctl disable iptables

鏋勫缓Dockerfile

鏋勫缓freeswitch闀滃儚鏃讹紝涓€璧锋妸nginx涔熸斁杩涘幓浜嗭紝涓轰簡鍚庣画浣跨敤Java瀵规帴freeswitch鏃朵笅杞藉綍闊崇敤锛涘ぇ闄嗗湴鍖轰笅杞芥捣澶栫殑鏈嶅姟渚濊禆浼氭瘮杈冩參锛岃繖閲屼娇鐢ㄤ簡鍗庝负闀滃儚(鍥犱负鎴戜滑浜戞湇鍔″叏閮ㄥ湪鍗庝负浜戜笂)锛屼篃鍙互鏇挎崲鎴恗irrors.aliyun.com鎴栬€卪irrors.163.com銆?/p>

FROM debian:bullseye
MAINTAINER caoliang1918 <caoliang1918@gmail.com>

WORKDIR /usr/local/freeswitch
ADD docker-entrypoint.sh /usr/local/
RUN chmod +x /usr/local/docker-entrypoint.sh

RUN echo voice9 >  /etc/hostname
RUN sed -i 's/http:\/\/deb.debian.org/http:\/\/mirrors.huaweicloud.com/g' /etc/apt/sources.list
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq install vim git sngrep

RUN git clone -b 'v1.10.10' <https://github.com/signalwire/freeswitch> /usr/src/freeswitch
RUN git clone -b 'v2.0.3'   <https://github.com/signalwire/libks> /usr/src/libs/libks
RUN git clone -b 'v1.13.17' <https://github.com/freeswitch/sofia-sip> /usr/src/libs/sofia-sip
RUN git clone <https://github.com/freeswitch/spandsp> /usr/src/libs/spandsp && cd /usr/src/libs/spandsp  &&  git  checkout  0d2e6ac
RUN git clone -b 'v2.0.0'   <https://github.com/signalwire/signalwire-c> /usr/src/libs/signalwire-c

RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install \
# nginx
   nginx \
# build
    build-essential cmake automake autoconf 'libtool-bin|libtool' pkg-config \
# general
    libssl-dev zlib1g-dev libdb-dev unixodbc-dev libncurses5-dev libexpat1-dev libgdbm-dev bison erlang-dev libtpl-dev libtiff5-dev uuid-dev \
# core
    libpcre3-dev libedit-dev libsqlite3-dev libcurl4-openssl-dev nasm \
# core codecs
    libogg-dev libspeex-dev libspeexdsp-dev \
# mod_enum
    libldns-dev \
# mod_python3
    python3-dev \
# mod_av
    libavformat-dev libswscale-dev libavresample-dev \
# mod_lua
    liblua5.2-dev \
# mod_opus
    libopus-dev \
# mod_pgsql
    libpq-dev \
# mod_sndfile
    libsndfile1-dev libflac-dev libogg-dev libvorbis-dev \
# mod_shout
    libshout3-dev libmpg123-dev libmp3lame-dev

RUN cd /usr/src/libs/libks && cmake . -DCMAKE_INSTALL_PREFIX=/usr -DWITH_LIBBACKTRACE=1 && make install
RUN cd /usr/src/libs/sofia-sip && ./bootstrap.sh && ./configure CFLAGS="-g -ggdb" --with-pic --with-glib=no --without-doxygen --disable-stun --prefix=/usr && make -j`nproc --all` && make install
RUN cd /usr/src/libs/spandsp  && ./bootstrap.sh && ./configure CFLAGS="-g -ggdb" --with-pic --prefix=/usr && make -j`nproc --all` && make install
RUN cd /usr/src/libs/signalwire-c && PKG_CONFIG_PATH=/usr/lib/pkgconfig cmake . -DCMAKE_INSTALL_PREFIX=/usr && make install

# Enable modules
RUN sed -i 's|#formats/mod_shout|formats/mod_shout|' /usr/src/freeswitch/build/modules.conf.in

RUN cd /usr/src/freeswitch && ./bootstrap.sh -j
RUN cd /usr/src/freeswitch && ./configure
RUN cd /usr/src/freeswitch && make -j`nproc` && make install

# Cleanup the image
RUN apt-get clean
RUN rm -rf /usr/src/*

ENTRYPOINT ["/usr/local/docker-entrypoint.sh"]

鍚姩鑴氭湰

docker-entrypoint.sh
#!/bin/bash
set -e

#echo "restart nginx"
/etc/init.d/nginx  start

echo "start freeswitch"
cd /usr/local/freeswitch/bin

exec ./freeswitch  -nonat -c

exec "$@"

鏋勫缓闀滃儚鑴氭湰

鎵цbuild.sh 鏋勫缓杩囩▼鏃堕棿浼氬緢涔咃紝濡傛灉娌℃湁缃戠粶鍔犻€熺幆澧冿紝澶ф鐜囨槸浼氬け璐ョ殑锛屽缓璁壘涓€涓綉缁滃姞閫熺幆澧冿紝涓€娆″け璐ュ氨鍐嶆敮鎸佷竴娆?姣曠珶澶辫触鏄垚鍔熶粬濡堭煣?
濡傛灉瀹炲湪涓嶆兂鏋勫缓锛屼篃鍙互鐩存帴鎷夊幓鎴戜滑鎻愪緵鐨勯暅鍍忥細
docker pull registry.cn-hangzhou.aliyuncs.com/voice9-x86/freeswitch-debian:1.10.10

#!/bin/bash

docker build -t registry.cn-hangzhou.aliyuncs.com/voice9-x86/freeswitch-debian:1.10.10  .

docker编译部署freeswitch-1.10.10,第1张

鍚姩freeswitch

docker-compose up -d 

freeswitch鎺у埗鍙?/h2>

./fs_cli.sh


docker编译部署freeswitch-1.10.10,第2张

GitHub锛歡ithub.com/caoliang1918/contact-center


https://www.xamrdz.com/backend/3za1940619.html

相关文章: