Skip to content

Commit

Permalink
Add Supervisor as build parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
muratugureminoglu committed Jan 6, 2025
1 parent 159979e commit b321f85
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions docker/Dockerfile_Process
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@
# * InstallMediaPush: Set this variable to 'true' to enable headless Chrome on the server for recording and streaming web pages back to Ant Media Server.
# --build-arg InstallMediaPush='true'
#
# * Supervisor Configuration (Optional)
# If you want to use Supervisor to manage the Ant Media Server process, you can uncomment the Supervisor-related section in the Dockerfile.
# With this configuration, you can easily restart, stop the service, or run the `enable_ssl.sh` script for Ant Media Server.
# * Supervisor Configuration (Optional): If you want to use Supervisor to manage the Ant Media Server process, you can enable as follows. With this configuration, you can easily restart, stop the service, or run the `enable_ssl.sh` script for Ant Media Server.
# --build-arg UseSupervisor='true'
#

FROM ubuntu:22.04

ARG AntMediaServer
ARG LicenseKey
ARG InstallMediaPush

ARG UseSupervisor=false
ARG BranchName=master

ENV UseSupervisor=${UseSupervisor}

#Running update and install makes the builder not to use cache which resolves some updates
RUN apt-get update && apt-get install -y curl wget iproute2 cron logrotate dnsutils iptables

Expand Down Expand Up @@ -96,22 +98,22 @@ RUN if [ "true" = "$InstallMediaPush" ]; then \


##################### supervisor configuration ##############################
#RUN apt-get update && apt-get install -y supervisor
#
#RUN echo '[supervisord]\n\
#nodaemon=true\n\
#\n\
#[program:antmedia]\n\
#command=/usr/local/antmedia/start.sh\n\
#autostart=true\n\
#autorestart=true\n\
#user=antmedia\n\
#stdout_logfile_maxbytes = 0\n\
#stderr_logfile_maxbytes = 0\n\
#stdout_logfile=/dev/stdout\n\
#stderr_logfile=/dev/stderr' > /etc/supervisor/supervisord.conf
#
#ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
RUN if [ "true" = "$UseSupervisor" ]; then \
apt-get update && apt-get install -y supervisor && \
echo '[supervisord]\n\
nodaemon=true\n\
\n\
[program:antmedia]\n\
command=/usr/local/antmedia/start.sh\n\
autostart=true\n\
autorestart=true\n\
user=antmedia\n\
stdout_logfile_maxbytes = 0\n\
stderr_logfile_maxbytes = 0\n\
stdout_logfile=/dev/stdout\n\
stderr_logfile=/dev/stderr' > /etc/supervisor/supervisord.conf; \
fi

##############################################################################

ENTRYPOINT ["/usr/local/antmedia/start.sh"]
ENTRYPOINT [ "sh", "-c", "if [ \"$UseSupervisor\" = \"true\" ]; then exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf; else exec /usr/local/antmedia/start.sh; fi" ]

0 comments on commit b321f85

Please sign in to comment.