diff --git a/Dockerfile b/Dockerfile index 870beec..a06c429 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,4 @@ -FROM ubuntu:focal - -LABEL maintainer="Kirill Plotnikov " \ - github="https://github.com/pltnk/docker-liquidsoap" +FROM debian:bookworm-slim AS builder ENV DEBIAN_FRONTEND=noninteractive @@ -10,11 +7,20 @@ RUN apt update && apt upgrade -y && \ apt install -y \ opam \ gcc \ + libavcodec-dev \ + libavdevice-dev \ + libavfilter-dev \ + libavformat-dev \ + libavutil-dev \ + libswresample-dev \ + libswscale-dev \ + libcurl4-gnutls-dev \ libmad0-dev \ libmp3lame-dev \ libogg-dev \ libpcre3-dev \ libsamplerate0-dev \ + libssl-dev \ libtag1-dev \ libvorbis-dev \ m4 \ @@ -24,26 +30,59 @@ RUN apt update && apt upgrade -y && \ apt autoremove && apt clean && \ rm -rf /var/lib/apt/lists/* -# add user for liquidsoap and create necessary directories -RUN groupadd -g 999 radio && \ - useradd -m -r -u 999 -s /bin/bash -g radio radio && \ - mkdir /etc/liquidsoap /music && \ - chown -R radio /etc/liquidsoap /music - ARG LIQUIDSOAP_VERSION -ARG OPAM_PACKAGES="liquidsoap${LIQUIDSOAP_VERSION:+.$LIQUIDSOAP_VERSION} taglib mad lame vorbis cry samplerate" - -USER radio +ARG OPAM_PACKAGES="liquidsoap${LIQUIDSOAP_VERSION:+.$LIQUIDSOAP_VERSION} taglib mad lame vorbis cry samplerate ssl ffmpeg" # setup opam -RUN opam init -a -y --disable-sandboxing && \ - eval $(opam env) && \ - opam install -y depext +RUN opam init -a -y --disable-sandboxing # install liquidsoap -RUN opam depext -y ${OPAM_PACKAGES} && \ - opam install -y ${OPAM_PACKAGES} && \ +RUN opam install -y ${OPAM_PACKAGES} && \ eval $(opam env) && \ opam clean -acryv --logs --unused-repositories CMD eval $(opam env) && liquidsoap /etc/liquidsoap/script.liq + + +FROM debian:bookworm-slim + +LABEL maintainer="Kirill Plotnikov " \ + github="https://github.com/pltnk/docker-liquidsoap" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update && apt upgrade -y && \ + apt install -y \ + libavcodec59 \ + libavdevice59 \ + libavfilter8 \ + libavformat59 \ + libavutil57 \ + libcurl3-gnutls \ + libmad0 \ + libmp3lame0 \ + libogg0 \ + libpcre3 \ + libsamplerate0 \ + libssl3 \ + libswresample4 \ + libswscale6 \ + libtag1v5-vanilla \ + libvorbis0a \ + libvorbisenc2 \ + libvorbisfile3 \ + && \ + apt autoremove && apt clean && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=builder /root/.opam/default/bin/liquidsoap /usr/local/bin + +# add user for liquidsoap and create necessary directories +RUN groupadd -g 999 radio && \ + useradd -m -r -u 999 -s /bin/bash -g radio radio && \ + mkdir /etc/liquidsoap /music && \ + chown -R radio /etc/liquidsoap /music + +USER radio + +CMD liquidsoap /etc/liquidsoap/script.liq