Replace PJSIP with pyVoIP - simpler, pure Python SIP library (v2.0.3)
This commit is contained in:
@@ -1,62 +1,14 @@
|
||||
ARG BUILD_FROM
|
||||
FROM $BUILD_FROM as builder
|
||||
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache \
|
||||
git \
|
||||
build-base \
|
||||
python3-dev \
|
||||
linux-headers \
|
||||
openssl-dev \
|
||||
alsa-lib-dev \
|
||||
opus-dev \
|
||||
speex-dev \
|
||||
speexdsp-dev \
|
||||
py3-pip
|
||||
|
||||
# Build PJSIP
|
||||
WORKDIR /tmp
|
||||
RUN git clone --depth 1 --branch 2.14.1 https://github.com/pjsip/pjproject.git && \
|
||||
cd pjproject && \
|
||||
./configure \
|
||||
--prefix=/opt/pjsip \
|
||||
--enable-shared \
|
||||
--disable-video \
|
||||
--disable-opencore-amr \
|
||||
--disable-silk \
|
||||
--disable-opus \
|
||||
--disable-resample \
|
||||
--disable-speex-aec \
|
||||
--disable-g711-codec \
|
||||
--disable-l16-codec \
|
||||
--disable-g722-codec && \
|
||||
make dep && \
|
||||
make && \
|
||||
make install && \
|
||||
cd pjsip-apps/src/python && \
|
||||
python3 setup.py build && \
|
||||
python3 setup.py install --prefix=/opt/pjsip
|
||||
|
||||
# Final stage
|
||||
FROM $BUILD_FROM
|
||||
|
||||
# Install runtime dependencies only
|
||||
# Install system dependencies
|
||||
RUN apk add --no-cache \
|
||||
python3 \
|
||||
py3-pip \
|
||||
ffmpeg \
|
||||
alsa-lib \
|
||||
openssl \
|
||||
opus \
|
||||
speex \
|
||||
speexdsp
|
||||
|
||||
# Copy PJSIP from builder
|
||||
COPY --from=builder /opt/pjsip /usr/local
|
||||
COPY --from=builder /usr/lib/python3.*/site-packages/pjsua2* /usr/lib/python3.11/site-packages/
|
||||
|
||||
# Update library cache
|
||||
RUN ldconfig /usr/local/lib || true
|
||||
gcc \
|
||||
musl-dev \
|
||||
python3-dev
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
Reference in New Issue
Block a user