From 63d93df5893d6dfa41f90d9951fe256ad8f11c4f Mon Sep 17 00:00:00 2001 From: jingzhaoyang Date: Tue, 19 Mar 2024 17:08:51 +0800 Subject: [PATCH] add Dockerfile and ci.yml fix modules.conf --- .github/workflows/ci.yml | 37 +++++++ docker/rts/.dockerignore | 0 docker/rts/Dockerfile | 54 ++++++++++ docker/rts/docker-entrypoint.sh | 5 + docker/rts/modules.conf | 173 ++++++++++++++++++++++++++++++++ 5 files changed, 269 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 docker/rts/.dockerignore create mode 100644 docker/rts/Dockerfile create mode 100644 docker/rts/docker-entrypoint.sh create mode 100644 docker/rts/modules.conf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..0b1cb8ae80 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: ci + +on: + push: + branches: + - 'main' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to TCR + uses: docker/login-action@v3 + with: + registry: xswitch.tencentcloudcr.com + username: ${{ secrets.DOCKER_LOGIN_USER }} + password: ${{ secrets.DOCKER_LOGIN_PASSWORD }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + file: ./docker/rts/Dockerfile + tags: xswitch.tencentcloudcr.com/xswitch/rts:latest diff --git a/docker/rts/.dockerignore b/docker/rts/.dockerignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docker/rts/Dockerfile b/docker/rts/Dockerfile new file mode 100644 index 0000000000..ad7e5b8982 --- /dev/null +++ b/docker/rts/Dockerfile @@ -0,0 +1,54 @@ +FROM xswitch.tencentcloudcr.com/xswitch/xswitch:bookworm as xswitch-build-bookworm +LABEL maintainer="Seven Du " +SHELL ["/bin/bash", "-c"] + +COPY . . + +RUN ls ./ && cp ./docker/rts/modules.conf ./ +ENV PKG_CONFIG_PATH=/usr/local/mrcp/lib/pkgconfig:/usr/local/freeswitch/lib/pkgconfig + +RUN ./bootstrap.sh && \ + ./configure --enable-core-odbc-support && \ + make -j $(nproc --all) && \ + make install + +## release-base for bookworm +FROM debian:bookworm-20230814-slim as bookworm-base +LABEL maintainer="Seven Du " + +SHELL ["/bin/bash", "-c"] + +RUN --mount=type=cache,target=/var/cache/apt,id=apt_cache,sharing=locked \ + rm -rf /var/cache/apt/archives/lock && \ + sed -i 's/Components: main/Components: main contrib non-free non-free-firmware/g' /etc/apt/sources.list.d/debian.sources && \ + apt-get update && apt-get install -y \ + --no-install-recommends --no-install-suggests --fix-missing \ + uuid zlib1g 'libjpeg8|libjpeg62-turbo' libpcap0.8 \ + libncurses5 libssl-dev libpcre3 libcurl4 \ + libedit2 libspeexdsp1 libatomic1 \ + libsqlite3-0 libgdbm6 libdb5.3 libvlc5 \ + libsndfile1 libopus0 liblua5.2-0 libtiff5-dev libswresample4 libfreetype6 \ + libpng16-16 yasm nasm libavformat59 libswscale6 libavfilter8 \ + libshout3 libmpg123-0 libmp3lame0 sntp \ + libmagickcore-6.q16-6 libjemalloc2 make \ + libhiredis0.14 unixodbc libpq5 librabbitmq4 librdkafka1 rrdtool \ + libmariadb3 libprotobuf-dev libprotobuf-c1 libopenal1 \ + libopencore-amrwb0 libvo-amrwbenc0 lua-rrd libpython3-dev \ + nano vim tcpdump net-tools ca-certificates curl wget gnupg \ + iputils-ping htop procps sngrep espeak-ng lua5.2 libgd-dev \ + && if [[ $(dpkg --print-architecture) == 'amd64' ]];then \ + apt-get install -y --no-install-recommends --no-install-suggests fdkaac odbc-mariadb ;fi \ + && rm -rf /var/lib/apt/lists/* + +RUN echo "kernel.core_pattern = /usr/local/freeswitch/log/core.%e.%p.%t" >> /etc/sysctl.conf +ENV PKG_CONFIG_PATH=/usr/local/mrcp/lib/pkgconfig:/usr/local/freeswitch/lib/pkgconfig + +# copy lib freeswitch from xswitch-build image +COPY --from=xswitch-build-bookworm /usr/local/lib /usr/local/lib +COPY --from=xswitch-build-bookworm /usr/local/freeswitch /usr/local/freeswitch + +RUN ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/ && \ + ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin/ +COPY ./docker/rts/docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod a+x /docker-entrypoint.sh +CMD ["/docker-entrypoint.sh"] diff --git a/docker/rts/docker-entrypoint.sh b/docker/rts/docker-entrypoint.sh new file mode 100644 index 0000000000..8d2e049831 --- /dev/null +++ b/docker/rts/docker-entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +ldconfig +systcl -p +LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 /usr/local/freeswitch/bin/freeswitch -c -rp -nonat -elegant-term -reincarnate-reexec diff --git a/docker/rts/modules.conf b/docker/rts/modules.conf new file mode 100644 index 0000000000..55d12c9a57 --- /dev/null +++ b/docker/rts/modules.conf @@ -0,0 +1,173 @@ +#applications/mod_abstraction +applications/mod_av +#applications/mod_avmd +#applications/mod_bert +#applications/mod_blacklist +applications/mod_callcenter +#applications/mod_cidlookup +#applications/mod_cluechoo +applications/mod_commands +applications/mod_conference +applications/mod_curl +#applications/mod_cv +applications/mod_db +#applications/mod_directory +applications/mod_distributor +applications/mod_dptools +#applications/mod_easyroute +#applications/mod_enum +applications/mod_esf +#applications/mod_esl +applications/mod_expr +applications/mod_fifo +#applications/mod_fsk +applications/mod_fsv +applications/mod_hash +applications/mod_hiredis +applications/mod_httapi +applications/mod_http_cache +#applications/mod_ladspa +#applications/mod_lcr +#applications/mod_memcache +#applications/mod_mongo +#applications/mod_mp4 +#applications/mod_mp4v2 +#applications/mod_nibblebill +#applications/mod_oreka +#applications/mod_osp +#applications/mod_prefix +#applications/mod_rad_auth +#applications/mod_redis +#applications/mod_rss +applications/mod_sms +#applications/mod_sms_flowroute +#applications/mod_snapshot +#applications/mod_snom +#applications/mod_sonar +#applications/mod_soundtouch +applications/mod_spandsp +#applications/mod_spy +#applications/mod_stress +#applications/mod_translate +applications/mod_valet_parking +applications/mod_video_filter +#applications/mod_vmd +applications/mod_voicemail +#applications/mod_voicemail_ivr +#asr_tts/mod_cepstral +#asr_tts/mod_flite +#asr_tts/mod_pocketsphinx +asr_tts/mod_tts_commandline +asr_tts/mod_unimrcp +codecs/mod_amr +codecs/mod_amrwb +#codecs/mod_b64 +#codecs/mod_bv +#codecs/mod_clearmode +#codecs/mod_codec2 +#codecs/mod_com_g729 +#codecs/mod_dahdi_codec +codecs/mod_g723_1 +codecs/mod_g729 +#codecs/mod_h26x +#codecs/mod_ilbc +#codecs/mod_isac +#codecs/mod_mp4v +codecs/mod_opus +#codecs/mod_sangoma_codec +#codecs/mod_silk +#codecs/mod_siren +#codecs/mod_theora +#dialplans/mod_dialplan_asterisk +#dialplans/mod_dialplan_directory +dialplans/mod_dialplan_xml +#directories/mod_ldap +#endpoints/mod_alsa +#endpoints/mod_dingaling +#endpoints/mod_gsmopen +#endpoints/mod_h323 +#endpoints/mod_khomp +endpoints/mod_loopback +#endpoints/mod_opal +#endpoints/mod_portaudio +endpoints/mod_rtc +endpoints/mod_rtmp +#endpoints/mod_skinny +endpoints/mod_sofia +endpoints/mod_verto +event_handlers/mod_amqp +event_handlers/mod_cdr_csv +#event_handlers/mod_cdr_mongodb +#event_handlers/mod_cdr_pg_csv +event_handlers/mod_cdr_sqlite +#event_handlers/mod_erlang_event +#event_handlers/mod_event_multicast +event_handlers/mod_event_socket +#event_handlers/mod_fail2ban +#event_handlers/mod_format_cdr +event_handlers/mod_json_cdr +#event_handlers/mod_radius_cdr +event_handlers/mod_odbc_cdr +#event_handlers/mod_kazoo +#event_handlers/mod_rayo +#event_handlers/mod_smpp +#event_handlers/mod_snmp +#event_handlers/mod_event_zmq +formats/mod_imagick +formats/mod_local_stream +formats/mod_native_file +formats/mod_png +#formats/mod_portaudio_stream +#formats/mod_shell_stream +formats/mod_shout +formats/mod_sndfile +#formats/mod_ssml +formats/mod_tone_stream +#formats/mod_vlc +#languages/mod_basic +#languages/mod_java +languages/mod_lua +#languages/mod_managed +#languages/mod_perl +#languages/mod_python +#languages/mod_v8 +#languages/mod_yaml +loggers/mod_console +#loggers/mod_graylog2 +loggers/mod_logfile +loggers/mod_syslog +#loggers/mod_raven +#say/mod_say_de +say/mod_say_en +#say/mod_say_es +#say/mod_say_es_ar +#say/mod_say_fa +#say/mod_say_fr +#say/mod_say_he +#say/mod_say_hr +#say/mod_say_hu +#say/mod_say_it +#say/mod_say_ja +#say/mod_say_nl +#say/mod_say_pl +#say/mod_say_pt +#say/mod_say_ru +#say/mod_say_sv +#say/mod_say_th +say/mod_say_zh +#timers/mod_posix_timer +#timers/mod_timerfd +xml_int/mod_xml_cdr +xml_int/mod_xml_curl +#xml_int/mod_xml_ldap +#xml_int/mod_xml_radius +#xml_int/mod_xml_rpc +#xml_int/mod_xml_scgi + +#../../libs/freetdm/mod_freetdm + +## Experimental Modules (don't cry if they're broken) +#../../contrib/mod/xml_int/mod_xml_odbc + +databases/mod_pgsql +