Skip to content

Commit

Permalink
Updated to use based ffmpeg:6.0-alpine. Reduce image size
Browse files Browse the repository at this point in the history
  • Loading branch information
VietND96 committed Oct 19, 2023
1 parent 792c847 commit 31ef618
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
35 changes: 12 additions & 23 deletions Video/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
FROM jrottenberg/ffmpeg:6.0-ubuntu2004
FROM jrottenberg/ffmpeg:6.0-alpine
LABEL authors="Selenium <[email protected]>"
LABEL authors="Happy TestOps <[email protected]>"

#================================================
# Customize sources for apt-get
#================================================
RUN echo "deb http://archive.ubuntu.com/ubuntu focal main universe\n" > /etc/apt/sources.list \
&& echo "deb http://archive.ubuntu.com/ubuntu focal-updates main universe\n" >> /etc/apt/sources.list \
&& echo "deb http://security.ubuntu.com/ubuntu focal-security main universe\n" >> /etc/apt/sources.list

# No interactive frontend during docker build
ENV DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true

#========================
# Supervisor
#========================
RUN apt-get -qqy update \
&& apt-get upgrade -yq \
&& apt-get -qqy --no-install-recommends install \
supervisor x11-xserver-utils x11-utils curl jq python3-pip \
&& python3 -m pip install --upgrade pip \
&& python3 -m pip install --upgrade setuptools \
&& python3 -m pip install --upgrade wheel \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
RUN apk update \
&& apk upgrade \
&& apk add --no-cache --update --virtual .build-deps supervisor bash curl jq xset python3 py3-psutil py3-pip \
&& ln -sf python3 /usr/bin/python \
&& rm -rf /tmp/* /var/cache/apk/*

ENV PYTHONUNBUFFERED=1
RUN python3 -m pip install --no-cache --upgrade --no-cache-dir pip urllib3 setuptools requests

#======================================
# Add Supervisor configuration files
#======================================
RUN mkdir -p /opt/bin/
RUN mkdir -p /var/run/supervisor /var/log/supervisor /videos

COPY supervisord.conf /etc
COPY entry_point.sh video.sh video_ready.py /opt/bin/
RUN cd /opt/bin && pip install psutil

RUN mkdir -p /var/run/supervisor /var/log/supervisor /videos

RUN chmod +x /opt/bin/*
ENTRYPOINT ["/opt/bin/entry_point.sh"]
Expand Down
3 changes: 2 additions & 1 deletion Video/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pidfile=/var/run/supervisor/supervisord.pid ; (supervisord pidfile;default sup
nodaemon=true ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
user=root

[program:video-recording]
priority=0
Expand All @@ -33,4 +34,4 @@ stopsignal=TERM
;Logs (all activity redirected to stdout so it can be seen through "docker logs"
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stdout_logfile_maxbytes=0

0 comments on commit 31ef618

Please sign in to comment.