diff --git a/supplemental/docker/prod/Dockerfile b/supplemental/docker/prod/Dockerfile index 0a2d9ba..d2ed427 100644 --- a/supplemental/docker/prod/Dockerfile +++ b/supplemental/docker/prod/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:xenial as base +FROM ubuntu:jammy as base ARG BUILD_REPO ARG MAIN_SUBDOMAIN=www @@ -19,6 +19,19 @@ LABEL org.opencontainers.image.source="https://github.com/IvanKuchin/${BUILD_REP RUN [ -z "$BUILD_REPO" ] && echo "BUILD_REPO is required" && exit 1 || true RUN echo repository is $BUILD_REPO +############################ +# make apt non-interactive # +############################ +ENV DEBIAN_FRONTEND noninteractive +ENV DEBCONF_NONINTERACTIVE_SEEN true + +#################### +# preseed timezone # +#################### +RUN echo tzdata tzdata/Areas select Europe > /tmp/preseed.txt \ + && echo tzdata tzdata/Zones/Europe select Moscow >> /tmp/preseed.txt \ + && debconf-set-selections /tmp/preseed.txt + ########################### # install basic utilities # ########################### @@ -30,15 +43,6 @@ RUN apt update \ gettext \ && rm -rf /var/lib/apt/lists/* -#################### -# install timezone # -#################### -#RUN apt-get install --no-install-recommends --no-install-suggests -y tzdata \ -# && rm -rf /var/lib/apt/lists/* -RUN cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime -RUN echo "Europe/Moscow" > /etc/timezone -RUN date - ############################## # install additional locales # ############################## @@ -66,9 +70,6 @@ ARG BUILD_RELEASE_NUMBER # install dependencies # ######################## RUN apt update \ - && apt-get install --no-install-recommends --no-install-suggests -y software-properties-common \ - && add-apt-repository -y ppa:jonathonf/ffmpeg-4 \ - && apt update \ && apt-get install --no-install-recommends --no-install-suggests -y \ build-essential \ file \ @@ -110,22 +111,22 @@ COPY . ${GIT_FOLDER} WORKDIR ${GIT_FOLDER} RUN git clone --depth 1 https://github.com/IvanKuchin/backend_pi.git ./src/pi -###################### -# libxl installation # -###################### -RUN if test -f "./libxl-3.8.4.0/lib64/libxl.so"; then \ - cp ./libxl-3.8.4.0/lib64/libxl.so /usr/local/lib/ \ - && ldconfig; \ - fi - -############################# -# libwkhtmltox installation # -############################# -RUN if test -d "./wkhtmltox"; then \ - wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb \ - && apt install --no-install-recommends --no-install-suggests -y ./wkhtmltox*.deb; \ - fi - +###################### +# libxl installation # +###################### +RUN if test -f "./libxl-3.8.4.0/lib64/libxl.so"; then \ + cp ./libxl-3.8.4.0/lib64/libxl.so /usr/local/lib/ \ + && ldconfig; \ + fi + +############################# +# libwkhtmltox installation # +############################# +RUN if test -d "./wkhtmltox"; then \ + wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb \ + && apt install --no-install-recommends --no-install-suggests -y ./wkhtmltox*.deb; \ + fi + ################## # save commit id # ################## @@ -190,7 +191,7 @@ RUN cd build \ # STOPSIGNAL SIGTERM -# CMD ["apachectl", "-D", "FOREGROUND", ""] +# CMD ["apachectl", "-D", "FOREGROUND"] ############################################################################################ @@ -212,17 +213,17 @@ COPY --from=build ${GIT_FOLDER}/build/${BUILD_REPO}-infra.deb ./ COPY --from=build ${GIT_FOLDER}/build/${BUILD_REPO}-app.deb ./ COPY --from=build ${GIT_FOLDER}/supplemental/apache2/ /etc/apache2/ -############### -# copy libxl # -############### -COPY --from=build /usr/local/lib/libxl* /usr/local/lib/ -RUN ldconfig - -################### -# copy wkhtmltox # -################### -COPY --from=build ${GIT_FOLDER}/wkhtmltox*.deb ./ - +############### +# copy libxl # +############### +COPY --from=build /usr/local/lib/libxl* /usr/local/lib/ +RUN ldconfig + +################### +# copy wkhtmltox # +################### +COPY --from=build ${GIT_FOLDER}/wkhtmltox*.deb ./ + #################### # install binaries # #################### @@ -231,10 +232,10 @@ RUN apt update \ #software-properties-common \ ssmtp \ apache2 \ - gsfonts \ - wget \ + gsfonts \ + wget \ && apt install --no-install-recommends --no-install-suggests -y ./*.deb \ - && apt remove -y wget \ + && apt remove -y wget \ && rm -rf /var/lib/apt/lists/* ######################### @@ -270,7 +271,7 @@ RUN chown -R www-data:www-data ${ROOTDIR} \ EXPOSE 80 -CMD ["apachectl", "-D", "FOREGROUND", ""] +CMD ["apachectl", "-D", "FOREGROUND"] ############################################################################################ @@ -297,12 +298,8 @@ COPY --from=build ${GIT_FOLDER}/supplemental/apache2/ /etc/apache2/ #################### RUN apt update \ && apt-get install --no-install-recommends --no-install-suggests -y \ - software-properties-common \ - # ssmtp \ apache2 \ - && add-apt-repository -y ppa:jonathonf/ffmpeg-4 \ - && apt update \ - && apt install --no-install-recommends --no-install-suggests -y ffmpeg \ + && apt install --no-install-recommends --no-install-suggests -y ffmpeg \ && apt install --no-install-recommends --no-install-suggests -y ./*.deb \ && apt autoremove -y software-properties-common \ && rm -rf /var/lib/apt/lists/* @@ -340,7 +337,7 @@ RUN chown -R www-data:www-data ${ROOTDIR} \ EXPOSE 80 -CMD ["apachectl", "-D", "FOREGROUND", ""] +CMD ["apachectl", "-D", "FOREGROUND"] ############################################################################################