Sign inSign up

58voip/3cx

By 58voip

•Updated over 2 years ago

3CX V20 for chinese user

Image
1

3.8K

58voip/3cx repository overview

Based on farfui/3cx⁠.

中文文档⁠

⁠Feature

  • replace debian default source to china 163 mirror
  • You can choose 80/443 port for web interface
  • Adapt UDP ports to 7000 - 10999
    • 7000 - 8499 for internal udp ports
    • 8500 - 8999 for internal webrtc ports
    • 9000 - 10499 for external udp ports
    • 10500 - 10999 for external webrtc ports

⁠Get Started

If you run the container on an APPARMOR enabled machine you have to add --security-opt apparmor=unconfined to the run command.

  1. Create a macvlan network. This is an example and you have to translate this command to map your needs.
docker network create \
-d macvlan \
--subnet 192.168.1.0/24 \
--gateway 192.168.1.1 \
-o parent=eth0 3cxnet
  1. Run the container
docker run \
    -d \
    --hostname {YOUR HOSTNAME} \
    --memory 1g \
    --ip {IP ADDRESS} \
    --network 3cxnet \
    --restart unless-stopped \
    -v 3cx_backup:/mnt/backup \
    -v 3cx_recordings:/mnt/recordings \
    -v 3cx_log:/var/log \
    -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
    --cap-add SYS_ADMIN \
    --name 3cx \
    58voip/3cx:latest
  1. Setup the timezone. You can find the full listing under "/usr/share/zoneinfo/". for example: Asia/Shanghai
docker exec 3cx timedatectl set-timezone {YOUR ZONE INFO}

Check timezone with command: docker exec 3cx timedatectl status .

  1. Start 3CX Wizard for initial setup
docker exec -ti 3cx /usr/sbin/3CXWizard --cleanup

⁠Dockerfile

FROM debian:buster
  
ARG BUILD_STRING
ARG BUILD_DATE
ARG BUILD_TIME

LABEL build.string $BUILD_STRING
LABEL build.date   $BUILD_DATE
LABEL build.time   $BUILD_TIME

ENV DEBIAN_FRONTEND noninteractive
ENV LANG en_US.UTF-8
ENV LANGUAGE en
ENV container docker

RUN sed -i 's/deb.debian.org/mirrors.163.com/g' /etc/apt/sources.list \
    && sed -i 's/security.debian.org/mirrors.163.com/g' /etc/apt/sources.list \
    &&   apt-get update -y \
    && apt-get upgrade -y \
    && apt-get install -y --allow-unauthenticated \
         apt-utils \
         wget \
         gnupg2 \
         systemd \
         locales \
    && sed -i 's/\# \(en_US.UTF-8\)/\1/' /etc/locale.gen \
    && locale-gen \
    && wget -O- http://downloads-global.3cx.com/downloads/3cxpbx/public.key | apt-key add - \
    && echo "deb http://downloads-global.3cx.com/downloads/debian buster main" | tee /etc/apt/sources.list.d/3cxpbx.list \
    && apt-get update -y \
    && apt-get install -y --allow-unauthenticated \
       net-tools \
       dphys-swapfile \
       $(apt-cache depends 3cxpbx | grep Depends | sed "s/.*ends:\ //" | tr '\n' ' ') \
    && rm -f /lib/systemd/system/multi-user.target.wants/* \
    && rm -f /etc/systemd/system/*.wants/* \
    && rm -f /lib/systemd/system/local-fs.target.wants/* \
    && rm -f /lib/systemd/system/sockets.target.wants/*udev* \
    && rm -f /lib/systemd/system/sockets.target.wants/*initctl* \
    && rm -f /lib/systemd/system/basic.target.wants/* \
    && rm -f /lib/systemd/system/anaconda.target.wants/*

EXPOSE 80/tcp 443/tcp 5015/tcp 5000/tcp 5001/tcp 5060/tcp 5060/udp 5061/tcp 5090/tcp 5090/udp 7000-10999/udp

CMD ["/lib/systemd/systemd"]

⁠How this container was build

#!/bin/bash
  
VERSION=latest
USER=58voip

docker rmi ${USER}/3cx:${VERSION}

docker build \
        --force-rm \
        --no-cache \
        --build-arg BUILD_STRING="$(date -u)" \
        --build-arg BUILD_DATE="$(date +%d-%m-%Y)" \
        --build-arg BUILD_TIME="$(date +%H:%M:%S)" \
        -t 3cx_stage1 .

docker run \
        -d \
        --privileged \
        --name 3cx_stage1_c 3cx_stage1

docker exec 3cx_stage1_c bash -c \
        "   systemctl mask systemd-logind console-getty.service [email protected] getty-static.service [email protected] [email protected] getty.target \
         && systemctl enable nginx exim4 postgresql \
         && echo 1 | apt-get -y install 3cxpbx"

docker stop 3cx_stage1_c

docker commit 3cx_stage1_c ${USER}/3cx:${VERSION}

docker push ${USER}/3cx:${VERSION}

docker rm 3cx_stage1_c

docker rmi 3cx_stage1

Tag summary

Content type

Image

Digest

sha256:ebeb51cb4…

Size

436.6 MB

Last updated

over 2 years ago

docker pull 58voip/3cx