From bee59864b8f382a7e9dc6a0147baeda7b5489693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= <1536036+zoic21@users.noreply.github.com> Date: Sat, 7 Sep 2024 11:51:15 +0200 Subject: [PATCH] Update Dockerfile --- Dockerfile | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index a5fabd5067..37a75bffed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG DEBIAN=bullseye +ARG DEBIAN=bookworm-slim FROM debian:${DEBIAN} ARG DEBIAN @@ -8,7 +8,15 @@ ENV WEBSERVER_HOME=${WEBSERVER_HOME} ARG VERSION=master ENV VERSION=${VERSION} ARG DATABASE=1 +ENV APACHE_HTTP_PORT=80 +ENV APACHE_HTTPS_PORT=443 ENV DATABASE=${DATABASE} +ENV DB_USERNAME=jeedom +ENV DB_NAME=jeedom +ENV DB_PORT=3306 +ENV DB_HOST=localhost +ENV TZ=America/Chicago +ENV DEBUG=0 # labels follows opencontainers convention LABEL org.opencontainers.image.title='Jeedom' @@ -25,37 +33,35 @@ WORKDIR ${WEBSERVER_HOME} VOLUME ${WEBSERVER_HOME} VOLUME /var/lib/mysql +#speed up build using docker cache +RUN apt update -y +RUN apt -o Dpkg::Options::="--force-confdef" -y install software-properties-common \ + ntp ca-certificates unzip curl sudo cron locate tar telnet wget logrotate dos2unix ntpdate htop \ + iotop vim iftop smbclient git python3 python3-pip libexpat1 ssl-cert \ + apt-transport-https xvfb cutycapt xauth at mariadb-client espeak net-tools nmap ffmpeg usbutils \ + gettext libcurl3-gnutls chromium librsync-dev ssl-cert iputils-ping \ + apache2 apache2-utils libexpat1 ssl-cert \ + php libapache2-mod-php php-json php-mysql php-curl php-gd php-imap php-xml php-opcache php-soap php-xmlrpc \ + php-common php-dev php-zip php-ssh2 php-mbstring php-ldap php-yaml php-snmp && apt -y remove brltty + COPY install/install.sh /tmp/ -# install step by step : step_1_upgrade RUN sh /tmp/install.sh -s 1 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -# step_2_mainpackage RUN sh /tmp/install.sh -s 2 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -# step_3_database RUN sh /tmp/install.sh -s 3 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -# step_4_apache RUN sh /tmp/install.sh -s 4 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -# step_5_php RUN sh /tmp/install.sh -s 5 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -# step 6 : copy jeedom source files COPY . ${WEBSERVER_HOME} -# step_7_jeedom_customization_mariadb RUN sh /tmp/install.sh -s 7 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -# step_8_jeedom_customization RUN sh /tmp/install.sh -s 8 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -# step_9_jeedom_configuration RUN sh /tmp/install.sh -s 9 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -# step_10_jeedom_installation RUN sh /tmp/install.sh -s 10 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -# step_11_jeedom_post RUN sh /tmp/install.sh -s 11 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +RUN apt-get clean && rm -rf /var/lib/apt/lists/* +RUN echo >${WEBSERVER_HOME}/initialisation -# cleanup -RUN apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# this file is a flag to trigger init.sh initialisation -RUN touch initialisation - +WORKDIR ${WEBSERVER_HOME} EXPOSE 80 -COPY install/OS_specific/Docker/init.sh /root/ -CMD ["bash", "/root/init.sh"] \ No newline at end of file +EXPOSE 443 +COPY --chown=root:root --chmod=550 install/OS_specific/Docker/init.sh /root/ +COPY --chown=root:root --chmod=550 install/bashrc /root/.bashrc +CMD ["bash", "/root/init.sh"]