Skip to content

Commit

Permalink
Merge pull request #52 from IvanKuchin/development
Browse files Browse the repository at this point in the history
Infrastructure: upgrade base-container to ubuntu:jammy
  • Loading branch information
IvanKuchin authored Aug 16, 2023
2 parents 4939fa6 + d566fec commit 8f29fd6
Showing 1 changed file with 48 additions and 51 deletions.
99 changes: 48 additions & 51 deletions supplemental/docker/prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:xenial as base
FROM ubuntu:jammy as base

ARG BUILD_REPO
ARG MAIN_SUBDOMAIN=www
Expand All @@ -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 #
###########################
Expand All @@ -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 #
##############################
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 #
##################
Expand Down Expand Up @@ -190,7 +191,7 @@ RUN cd build \

# STOPSIGNAL SIGTERM

# CMD ["apachectl", "-D", "FOREGROUND", ""]
# CMD ["apachectl", "-D", "FOREGROUND"]

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

Expand All @@ -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 #
####################
Expand All @@ -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/*

#########################
Expand Down Expand Up @@ -270,7 +271,7 @@ RUN chown -R www-data:www-data ${ROOTDIR} \

EXPOSE 80

CMD ["apachectl", "-D", "FOREGROUND", ""]
CMD ["apachectl", "-D", "FOREGROUND"]

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

Expand All @@ -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/*
Expand Down Expand Up @@ -340,7 +337,7 @@ RUN chown -R www-data:www-data ${ROOTDIR} \

EXPOSE 80

CMD ["apachectl", "-D", "FOREGROUND", ""]
CMD ["apachectl", "-D", "FOREGROUND"]

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

Expand Down

0 comments on commit 8f29fd6

Please sign in to comment.