diff --git a/.env b/.env index 6d4d2e0..c365953 100644 --- a/.env +++ b/.env @@ -14,4 +14,4 @@ NGINX_HTTPS_IPV6_PORT=8843 NGINX_CONTAINER_HTTP_PORT=80 NGINX_CONTAINER_HTTPS_PORT=443 -PHP_VERSIONS= +PHP_VERSIONS=7.4 7.2 diff --git a/mariadb-srv/project/entrypoint/entrypoint.sh b/mariadb-srv/project/entrypoint/entrypoint.sh index d362bb0..65b9669 100644 --- a/mariadb-srv/project/entrypoint/entrypoint.sh +++ b/mariadb-srv/project/entrypoint/entrypoint.sh @@ -1,6 +1,7 @@ #!/bin/sh service mariadb start + # Run the CMD that was passed (or default) exec "$@" diff --git a/multi-php-fpm/Dockerfile b/multi-php-fpm/Dockerfile index 7458438..7a00818 100644 --- a/multi-php-fpm/Dockerfile +++ b/multi-php-fpm/Dockerfile @@ -1,21 +1,20 @@ FROM debian:bookworm -ARG DEBIAN_FRONTEND=noninteractive -ARG DEBCONF_NONINTERACTIVE_SEEN=true -RUN apt-get update; apt-get full-upgrade -y; apt-get autoclean -y && apt install iputils-ping -y +ENV DEBIAN_FRONTEND=noninteractive +ENV DEBCONF_NONINTERACTIVE_SEEN=true +RUN apt-get update; apt-get full-upgrade -y; apt-get autoclean -y && apt-get install iputils-ping -y COPY project/buildtime/sury-repo.sh /tmp/buildtime/sury-repo.sh RUN /bin/sh /tmp/buildtime/sury-repo.sh -ARG BUILDTIME_PHP_VER_INST="8.2" +ENV BUILDTIME_PHP_VER_INST="8.2" COPY project/buildtime/buildtime_php_ver_inst.sh /tmp/buildtime/buildtime_php_ver_inst.sh -COPY project/buildtime/preserve-files.sh /tmp/buildtime/preserve-files.sh RUN /bin/sh /tmp/buildtime/buildtime_php_ver_inst.sh ENV DEF_PHP_INTERPRETER="8.2" ENV PHP_VERSIONS= COPY project/entrypoint/entrypoint.sh /entrypoint/entrypoint.sh +COPY project/entrypoint/container-php-ver-inst.sh /entrypoint/container-php-ver-inst.sh COPY project/entrypoint/install-php-versions.sh /entrypoint/install-php-versions.sh COPY project/entrypoint/start-php-fpm.sh /entrypoint/start-php-fpm.sh -RUN /bin/sh /tmp/buildtime/preserve-files.sh ENTRYPOINT ["/bin/sh", "/entrypoint/entrypoint.sh"] diff --git a/multi-php-fpm/project/buildtime/buildtime_php_ver_inst.sh b/multi-php-fpm/project/buildtime/buildtime_php_ver_inst.sh index b21e48f..584eed9 100644 --- a/multi-php-fpm/project/buildtime/buildtime_php_ver_inst.sh +++ b/multi-php-fpm/project/buildtime/buildtime_php_ver_inst.sh @@ -4,7 +4,7 @@ apt-get update BUILDTIME_PHP_VER_INST="8.2" -apt-get install -y \ +apt-get install -y --download-only \ php$BUILDTIME_PHP_VER_INST-fpm \ php$BUILDTIME_PHP_VER_INST-bcmath \ php$BUILDTIME_PHP_VER_INST-bz2 \ diff --git a/multi-php-fpm/project/buildtime/preserve-files.sh b/multi-php-fpm/project/buildtime/preserve-files.sh deleted file mode 100644 index b6a1495..0000000 --- a/multi-php-fpm/project/buildtime/preserve-files.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -mkdir -p /tmp/buildtime/etc/php -mv /etc/php/* /tmp/buildtime/etc/php/ diff --git a/multi-php-fpm/project/buildtime/sury-repo.sh b/multi-php-fpm/project/buildtime/sury-repo.sh index 0976f8f..9fe6838 100644 --- a/multi-php-fpm/project/buildtime/sury-repo.sh +++ b/multi-php-fpm/project/buildtime/sury-repo.sh @@ -1,7 +1,7 @@ #!/bin/sh # To add this repository please do: -apt-get -y install lsb-release ca-certificates curl +apt-get install lsb-release ca-certificates curl -y curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb dpkg -i /tmp/debsuryorg-archive-keyring.deb sh -c 'echo "deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' diff --git a/multi-php-fpm/project/entrypoint/container-php-ver-inst.sh b/multi-php-fpm/project/entrypoint/container-php-ver-inst.sh new file mode 100644 index 0000000..92db7e3 --- /dev/null +++ b/multi-php-fpm/project/entrypoint/container-php-ver-inst.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +apt-get update + +apt-get install -y \ + php$BUILDTIME_PHP_VER_INST-fpm \ + php$BUILDTIME_PHP_VER_INST-bcmath \ + php$BUILDTIME_PHP_VER_INST-bz2 \ + php$BUILDTIME_PHP_VER_INST-common \ + php$BUILDTIME_PHP_VER_INST-curl \ + php$BUILDTIME_PHP_VER_INST-dba \ + php$BUILDTIME_PHP_VER_INST-enchant \ + php$BUILDTIME_PHP_VER_INST-gd \ + php$BUILDTIME_PHP_VER_INST-gmp \ + php$BUILDTIME_PHP_VER_INST-http \ + php$BUILDTIME_PHP_VER_INST-imap \ + php$BUILDTIME_PHP_VER_INST-interbase \ + php$BUILDTIME_PHP_VER_INST-intl \ + php$BUILDTIME_PHP_VER_INST-ldap \ + php$BUILDTIME_PHP_VER_INST-mbstring \ + php$BUILDTIME_PHP_VER_INST-memcache \ + php$BUILDTIME_PHP_VER_INST-memcached \ + php$BUILDTIME_PHP_VER_INST-mysql \ + php$BUILDTIME_PHP_VER_INST-odbc \ + php$BUILDTIME_PHP_VER_INST-opcache \ + php$BUILDTIME_PHP_VER_INST-pgsql \ + php$BUILDTIME_PHP_VER_INST-ps \ + php$BUILDTIME_PHP_VER_INST-pspell \ + php$BUILDTIME_PHP_VER_INST-raphf \ + php$BUILDTIME_PHP_VER_INST-readline \ + php$BUILDTIME_PHP_VER_INST-snmp \ + php$BUILDTIME_PHP_VER_INST-soap \ + php$BUILDTIME_PHP_VER_INST-sqlite3 \ + php$BUILDTIME_PHP_VER_INST-stomp \ + php$BUILDTIME_PHP_VER_INST-sybase \ + php$BUILDTIME_PHP_VER_INST-tidy \ + php$BUILDTIME_PHP_VER_INST-xdebug \ + php$BUILDTIME_PHP_VER_INST-xml \ + php$BUILDTIME_PHP_VER_INST-xsl \ + php$BUILDTIME_PHP_VER_INST-zip \ diff --git a/multi-php-fpm/project/entrypoint/entrypoint.sh b/multi-php-fpm/project/entrypoint/entrypoint.sh index 9ba9189..e98bc51 100644 --- a/multi-php-fpm/project/entrypoint/entrypoint.sh +++ b/multi-php-fpm/project/entrypoint/entrypoint.sh @@ -1,9 +1,10 @@ #!/bin/sh +/bin/sh /entrypoint/container-php-ver-inst.sh /bin/sh /entrypoint/install-php-versions.sh # Run the CMD that was passed (or default) -#exec "$@" +exec "$@" tail -f /dev/null diff --git a/multi-php-fpm/project/entrypoint/start-php-fpm.sh b/multi-php-fpm/project/entrypoint/start-php-fpm.sh index 03ad5e9..c5c52fb 100644 --- a/multi-php-fpm/project/entrypoint/start-php-fpm.sh +++ b/multi-php-fpm/project/entrypoint/start-php-fpm.sh @@ -1,7 +1,5 @@ #!/bin/sh -mkdir -p /etc/php # Creates /etc/php if it doesn't exist -mv /tmp/buildtime/etc/php/* /etc/php/ # Start each version listed in PHP_VERSIONS for version in $PHP_VERSIONS; do diff --git a/nginx-srv/Dockerfile b/nginx-srv/Dockerfile index fdb7519..231703b 100644 --- a/nginx-srv/Dockerfile +++ b/nginx-srv/Dockerfile @@ -3,12 +3,8 @@ FROM debian:bookworm ARG DEBIAN_FRONTEND=noninteractive ARG DEBCONF_NONINTERACTIVE_SEEN=true -RUN apt-get update; apt-get full-upgrade -y; apt-get autoclean -y; apt-get install nginx certbot python3-certbot-nginx openssl vim curl iputils-ping -y +RUN apt-get update; apt-get full-upgrade -y; apt-get autoclean -y; apt-get install nginx certbot python3-certbot-nginx openssl vim curl iputils-ping -y --download-only COPY project/entrypoint/entrypoint.sh /entrypoint/entrypoint.sh COPY project/entrypoint/gen-cert.sh /entrypoint/gen-cert.sh -#COPY project/entrypoint/install-nginx-mods.sh /entrypoint/install-nginx-mods.sh -RUN mkdir /tmp/buildtime && cp /etc/nginx/sites-available/default /tmp/buildtime/default -RUN mkdir /tmp/buildtime/www && cp -r /var/www/. /tmp/buildtime/www/ -RUN mkdir /tmp/buildtime/letsencrypt && cp -r /etc/letsencrypt/. /tmp/buildtime/letsencrypt/ ENTRYPOINT ["/bin/sh", "/entrypoint/entrypoint.sh"] diff --git a/nginx-srv/project/entrypoint/entrypoint.sh b/nginx-srv/project/entrypoint/entrypoint.sh index b40c4cf..de1b533 100644 --- a/nginx-srv/project/entrypoint/entrypoint.sh +++ b/nginx-srv/project/entrypoint/entrypoint.sh @@ -2,21 +2,7 @@ /bin/sh /entrypoint/gen-cert.sh -for file in /etc/nginx/sites-available/*.conf; do - ln -s "$file" "/etc/nginx/sites-enabled/" -done - -rm /etc/nginx/sites-enabled/*.conf -mv /tmp/buildtime/default /etc/nginx/sites-available/default - -if [ "$(ls -A /etc/letsencrypt)" ]; then - mv /tmp/buildtime/letsencrypt/* /etc/letsencrypt -fi - -# One-liner with test - -cp -a /tmp/buildtime/www/html* /var/www/html && rm -rf /tmp/buildtime/www/html -chown -R www-data:www-data /var/www -service nginx start +# Run the CMD that was passed (or default) +exec "$@" tail -f /dev/null diff --git a/nginx-srv/project/entrypoint/gen-cert.sh b/nginx-srv/project/entrypoint/gen-cert.sh index aa0bad7..b2df9b5 100644 --- a/nginx-srv/project/entrypoint/gen-cert.sh +++ b/nginx-srv/project/entrypoint/gen-cert.sh @@ -5,6 +5,7 @@ mkdir -p /etc/ssl/private chmod 0710 /etc/ssl/private # Generate a fresh cert every time +apt-get install -y openssl openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \ -keyout /etc/ssl/private/ssl-cert-snakeoil.key \ -out /etc/ssl/certs/ssl-cert-snakeoil.pem \