From 33c48a69a5020aec804beb7c08861de6daaad618 Mon Sep 17 00:00:00 2001 From: JessyS Date: Wed, 28 May 2025 15:35:33 -0400 Subject: [PATCH] Test branch protection --- Dockerfile | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dfa1dae --- /dev/null +++ b/Dockerfile @@ -0,0 +1,80 @@ +# Use Debian 12 slim as the base image +FROM debian:12-slim + +# Install dependencies (minimal set) +RUN apt-get update -y && \ + apt-get install -y --no-install-recommends \ + gnupg2 \ + wget \ + lsb-release \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +# Add FreeSWITCH public repo via build-arg +ARG SW_TOKEN +RUN wget --http-user=signalwire --http-password=${SW_TOKEN} \ + -O /usr/share/keyrings/signalwire-freeswitch-repo.gpg \ + https://freeswitch.signalwire.com/repo/deb/debian-release/signalwire-freeswitch-repo.gpg && \ + echo "machine freeswitch.signalwire.com login signalwire password ${SW_TOKEN}" > /etc/apt/auth.conf && \ + chmod 600 /etc/apt/auth.conf && \ + echo "deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/freeswitch.list && \ + apt-get update -y + +# Install FreeSWITCH with core + logging modules +RUN apt-get install -y --no-install-recommends \ + freeswitch-meta-vanilla \ + # Core modules + freeswitch-mod-commands \ + freeswitch-mod-sofia \ + freeswitch-mod-dialplan-xml \ + freeswitch-mod-loopback \ + freeswitch-mod-event-socket \ + # Logging modules + freeswitch-mod-console \ + freeswitch-mod-logfile \ + freeswitch-mod-syslog \ + freeswitch-mod-graylog2 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Configure logging directories and permissions +RUN mkdir -p \ + /etc/freeswitch \ + /var/lib/freeswitch/recordings \ + /var/log/freeswitch \ + /usr/share/freeswitch/scripts && \ + chown -R freeswitch:freeswitch \ + /etc/freeswitch \ + /var/lib/freeswitch \ + /var/log/freeswitch \ + /usr/share/freeswitch/scripts + +# Copy default logging config (optional) +# COPY conf/autoload_configs/logfile.conf.xml /etc/freeswitch/autoload_configs/ + +# Expose ports +EXPOSE 5060/tcp 5060/udp +EXPOSE 5080/tcp 5080/udp +EXPOSE 8021/tcp +EXPOSE 16384-32768/udp + +# Runtime configuration +USER freeswitch +WORKDIR /usr/share/freeswitch + +# Healthcheck +HEALTHCHECK --start-period=15s --interval=30s --timeout=5s \ + CMD fs_cli -x "status" | grep -q "UP" || exit 1 + +# Start command with complete path specification +CMD ["freeswitch", \ + "-u", "freeswitch", \ + "-g", "freeswitch", \ + "-nonat", \ + "-nf", \ + "-nc", \ + "-rp", \ + "-conf", "/etc/freeswitch", \ + "-log", "/var/log/freeswitch", \ + "-db", "/var/lib/freeswitch/db"] +TEST=blocked