Optimize Docker build and libs installed for LS.
This commit is contained in:
parent
fed474b116
commit
fdb01fadca
31
Dockerfile
31
Dockerfile
|
@ -20,7 +20,7 @@ FROM mariadb:10.9-jammy AS mariadb
|
||||||
#
|
#
|
||||||
# Final build image
|
# Final build image
|
||||||
#
|
#
|
||||||
FROM ubuntu:jammy
|
FROM ubuntu:jammy AS pre-final
|
||||||
|
|
||||||
ENV TZ="UTC"
|
ENV TZ="UTC"
|
||||||
|
|
||||||
|
@ -34,15 +34,12 @@ COPY --from=go-dependencies /go/bin/centrifugo /usr/local/bin/centrifugo
|
||||||
|
|
||||||
# Run base build process
|
# Run base build process
|
||||||
COPY ./util/docker/common /bd_build/
|
COPY ./util/docker/common /bd_build/
|
||||||
RUN chmod a+x /bd_build/*.sh \
|
RUN bash /bd_build/prepare.sh \
|
||||||
&& /bd_build/prepare.sh \
|
&& bash /bd_build/add_user.sh \
|
||||||
&& /bd_build/add_user.sh \
|
&& bash /bd_build/cleanup.sh \
|
||||||
&& /bd_build/cleanup.sh \
|
|
||||||
&& rm -rf /bd_build
|
&& rm -rf /bd_build
|
||||||
|
|
||||||
# Build each set of dependencies in their own step for cacheability.
|
# Build each set of dependencies in their own step for cacheability.
|
||||||
ARG ARM_FULL_BUILD
|
|
||||||
|
|
||||||
COPY ./util/docker/supervisor /bd_build/supervisor/
|
COPY ./util/docker/supervisor /bd_build/supervisor/
|
||||||
RUN bash /bd_build/supervisor/setup.sh \
|
RUN bash /bd_build/supervisor/setup.sh \
|
||||||
&& rm -rf /bd_build/supervisor
|
&& rm -rf /bd_build/supervisor
|
||||||
|
@ -63,9 +60,17 @@ COPY ./util/docker/redis /bd_build/redis/
|
||||||
RUN bash /bd_build/redis/setup.sh \
|
RUN bash /bd_build/redis/setup.sh \
|
||||||
&& rm -rf /bd_build/redis
|
&& rm -rf /bd_build/redis
|
||||||
|
|
||||||
|
RUN rm -rf /bd_build
|
||||||
|
|
||||||
|
VOLUME ["/var/azuracast/stations", "/var/azuracast/uploads", "/var/azuracast/backups", "/var/azuracast/sftpgo/persist", "/var/azuracast/servers/shoutcast2"]
|
||||||
|
|
||||||
#
|
#
|
||||||
# START Operations as `azuracast` user
|
# Final build (Just environment vars and squishing the FS)
|
||||||
#
|
#
|
||||||
|
FROM ubuntu:jammy AS final
|
||||||
|
|
||||||
|
COPY --from=pre-final / /
|
||||||
|
|
||||||
USER azuracast
|
USER azuracast
|
||||||
|
|
||||||
WORKDIR /var/azuracast/www
|
WORKDIR /var/azuracast/www
|
||||||
|
@ -82,19 +87,15 @@ COPY --chown=azuracast:azuracast . .
|
||||||
RUN composer dump-autoload --optimize --classmap-authoritative \
|
RUN composer dump-autoload --optimize --classmap-authoritative \
|
||||||
&& touch /var/azuracast/.docker
|
&& touch /var/azuracast/.docker
|
||||||
|
|
||||||
VOLUME ["/var/azuracast/stations", "/var/azuracast/uploads", "/var/azuracast/backups", "/var/azuracast/sftpgo/persist", "/var/azuracast/servers/shoutcast2"]
|
|
||||||
ENV PATH="${PATH}:/var/azuracast/servers/shoutcast2"
|
|
||||||
|
|
||||||
#
|
|
||||||
# END Operations as `azuracast` user
|
|
||||||
#
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
EXPOSE 80 2022
|
EXPOSE 80 2022
|
||||||
EXPOSE 8000-8999
|
EXPOSE 8000-8999
|
||||||
|
|
||||||
# Sensible default environment variables.
|
# Sensible default environment variables.
|
||||||
ENV LANG="en_US.UTF-8" \
|
ENV TZ="UTC" \
|
||||||
|
LANG="en_US.UTF-8" \
|
||||||
|
PATH="${PATH}:/var/azuracast/servers/shoutcast2" \
|
||||||
DOCKER_IS_STANDALONE="true" \
|
DOCKER_IS_STANDALONE="true" \
|
||||||
APPLICATION_ENV="production" \
|
APPLICATION_ENV="production" \
|
||||||
MYSQL_HOST="localhost" \
|
MYSQL_HOST="localhost" \
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
opam init --disable-sandboxing -a --bare && opam switch create 4.13.1
|
|
||||||
|
|
||||||
# Pin specific commit of Liquidsoap
|
|
||||||
# opam pin add --no-action liquidsoap https://github.com/savonet/liquidsoap.git#dee2e1553b87e6343d37df4525025af2bea24da8
|
|
||||||
|
|
||||||
opam install -y ladspa.0.2.2 ffmpeg.1.1.3 ffmpeg-avutil.1.1.3 ffmpeg-avcodec.1.1.3 ffmpeg-avdevice.1.1.3 \
|
|
||||||
ffmpeg-av.1.1.3 ffmpeg-avfilter.1.1.3 ffmpeg-swresample.1.1.3 ffmpeg-swscale.1.1.3 frei0r.0.1.2 \
|
|
||||||
samplerate.0.1.6 taglib.0.3.9 mad.0.5.2 faad.0.5.0 fdkaac.0.3.2 lame.0.3.6 vorbis.0.8.0 cry.0.6.7 \
|
|
||||||
flac.0.3.0 opus.0.2.1 dtools.0.4.4 duppy.0.9.2 ocurl.0.9.2 ssl.0.5.10 \
|
|
||||||
liquidsoap.2.0.4
|
|
||||||
|
|
||||||
# Have Liquidsoap build its own chroot.
|
|
||||||
mkdir -p /tmp/liquidsoap
|
|
||||||
|
|
||||||
/var/azuracast/.opam/4.13.1/bin/liquidsoap /bd_build/stations/liquidsoap/build_chroot.liq || true
|
|
||||||
|
|
||||||
# Clear entire OPAM directory
|
|
||||||
rm -rf /var/azuracast/.opam
|
|
||||||
|
|
||||||
cp -r /tmp/liquidsoap/var/azuracast/.opam /var/azuracast/.opam
|
|
||||||
rm -rf /tmp/liquidsoap
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
apt-get install -y --no-install-recommends flac
|
|
|
@ -3,15 +3,16 @@ set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# Packages required by Liquidsoap
|
# Packages required by Liquidsoap
|
||||||
apt-get install -y --no-install-recommends libao-dev libasound2-dev libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev \
|
apt-get install -y --no-install-recommends \
|
||||||
libavutil-dev libfaad-dev libfdk-aac-dev libflac-dev libfreetype-dev libgd-dev libjack-dev \
|
libao4 libfaad2 libfdk-aac2 libgd3 liblo7 libmad0 libmagic1 libportaudio2 \
|
||||||
libjpeg-dev liblo-dev libmad0-dev libmagic-dev libmp3lame-dev libopus-dev libpng-dev libportaudio2 \
|
libsdl2-image-2.0-0 libsdl2-ttf-2.0-0 libsoundtouch1 libxpm4 \
|
||||||
libpulse-dev libsamplerate0-dev libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libshine-dev libsoundtouch-dev libspeex-dev \
|
libasound2 libavcodec58 libavdevice58 libavfilter7 libavformat58 libavutil56 \
|
||||||
libsrt-openssl-dev libswresample-dev libswscale-dev libtag1-dev libtheora-dev libtiff-dev libx11-dev libxpm-dev \
|
libpulse0 libsamplerate0 libswresample3 libswscale5 libtag1v5 \
|
||||||
bubblewrap ffmpeg
|
libsrt1.4-openssl bubblewrap ffmpeg
|
||||||
|
|
||||||
# Optional audio plugins
|
# Optional audio plugins
|
||||||
apt-get install -y --no-install-recommends frei0r-plugins-dev ladspa-sdk multimedia-audio-plugins swh-plugins tap-plugins lsp-plugins-ladspa
|
apt-get install -y --no-install-recommends frei0r-plugins-dev ladspa-sdk multimedia-audio-plugins swh-plugins \
|
||||||
|
tap-plugins lsp-plugins-ladspa
|
||||||
|
|
||||||
# Per-architecture LS installs
|
# Per-architecture LS installs
|
||||||
ARCHITECTURE=amd64
|
ARCHITECTURE=amd64
|
||||||
|
@ -28,11 +29,3 @@ dpkg -i /tmp/liquidsoap.deb
|
||||||
apt-get install -y -f --no-install-recommends
|
apt-get install -y -f --no-install-recommends
|
||||||
rm -f /tmp/liquidsoap.deb
|
rm -f /tmp/liquidsoap.deb
|
||||||
ln -s /usr/bin/liquidsoap /usr/local/bin/liquidsoap
|
ln -s /usr/bin/liquidsoap /usr/local/bin/liquidsoap
|
||||||
|
|
||||||
# else
|
|
||||||
# apt-get install -y --no-install-recommends build-essential libssl-dev libcurl4-openssl-dev m4 ocaml opam autoconf automake
|
|
||||||
# sudo -u azuracast bash /bd_build/stations/liquidsoap/build_as_azuracast.sh
|
|
||||||
# ln -s /var/azuracast/.opam/4.13.1/bin/liquidsoap /usr/local/bin/liquidsoap
|
|
||||||
# chmod a+x /usr/local/bin/liquidsoap
|
|
||||||
# apt-get purge -y build-essential libssl-dev libcurl4-openssl-dev m4 ocaml opam autoconf automake
|
|
||||||
# fi
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
apt-get install -y --no-install-recommends vorbis-tools
|
|
|
@ -3,7 +3,7 @@ set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
apt-get install -y --no-install-recommends python3-minimal python3-pip
|
apt-get install -y --no-install-recommends python3-minimal python3-pip
|
||||||
pip3 install setuptools supervisor \
|
pip3 install --no-cache-dir setuptools supervisor \
|
||||||
git+https://github.com/coderanger/supervisor-stdout
|
git+https://github.com/coderanger/supervisor-stdout
|
||||||
|
|
||||||
# apt-get install -y --no-install-recommends supervisor
|
# apt-get install -y --no-install-recommends supervisor
|
||||||
|
|
Loading…
Reference in New Issue