diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7c35ce0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +# Only the files the image build actually needs enter the build context +* +!artifacts/ +!cron +**/.DS_Store diff --git a/.gitignore b/.gitignore index 8e7b11a..c50cb1d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode **/.DS_Store +data_sendy/ diff --git a/Dockerfile b/Dockerfile index b216c2d..0ef682c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,28 +10,28 @@ # Run: # $ docker run --rm -d --env-file sendy.env sendy:latest -FROM php:8.0-apache as sendy +FROM php:8.0-apache AS sendy -ARG SENDY_VER=6.0.4 -ARG ARTIFACT_DIR=6.0.4 +ARG SENDY_VER=7.0.6 +ARG ARTIFACT_DIR=7.0.6 -ENV SENDY_VERSION ${SENDY_VER} +ENV SENDY_VERSION=${SENDY_VER} RUN apt -qq update && apt -qq upgrade -y \ # Install unzip cron - && apt -qq install -y unzip cron \ + && apt -qq install -y --no-install-recommends unzip cron \ # Install php extension gettext # Install php extension mysqli && docker-php-ext-install calendar gettext mysqli \ - # Remove unused packages - && apt autoremove -y + # Remove unused packages and apt caches + && apt autoremove -y \ + && apt clean \ + && rm -rf /var/lib/apt/lists/* -# Copy artifacts -COPY ./artifacts/${ARTIFACT_DIR}/ /tmp - -# Install Sendy -RUN unzip /tmp/sendy-${SENDY_VER}.zip -d /tmp \ - && cp -r /tmp/includes/* /tmp/sendy/includes \ +# Install Sendy (artifacts are bind-mounted at build time; no COPY layer) +RUN --mount=type=bind,source=artifacts/${ARTIFACT_DIR},target=/artifacts \ + unzip -q /artifacts/sendy-${SENDY_VER}.zip -d /tmp \ + && cp -r /artifacts/includes/* /tmp/sendy/includes \ && mkdir -p /tmp/sendy/uploads/csvs \ && chmod -R 777 /tmp/sendy/uploads \ && rm -rf /var/www/html \ @@ -46,11 +46,8 @@ RUN unzip /tmp/sendy-${SENDY_VER}.zip -d /tmp \ Header unset \"X-Powered-By\"\n" >> /var/www/html/.htaccess \ && printf "[PHP]\nerror_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED\n" > /usr/local/etc/php/conf.d/error_reporting.ini -# Apache config -RUN a2enconf serverName - -# Apache modules -RUN a2enmod rewrite headers +# Apache config and modules +RUN a2enconf serverName && a2enmod rewrite headers # Copy hello-cron file to the cron.d directory COPY cron /etc/cron.d/cron @@ -68,7 +65,7 @@ CMD ["apache2-foreground"] ####################### # XDEBUG Installation ####################### -FROM sendy as debug +FROM sendy AS debug # Install xdebug extension RUN pecl channel-update pecl.php.net \ && pecl install xdebug \ diff --git a/artifacts/6.0.4/includes/config.php b/artifacts/7.0.6/includes/config.php similarity index 100% rename from artifacts/6.0.4/includes/config.php rename to artifacts/7.0.6/includes/config.php diff --git a/artifacts/6.0.4/sendy-6.0.4.zip b/artifacts/7.0.6/sendy-7.0.6.zip similarity index 64% rename from artifacts/6.0.4/sendy-6.0.4.zip rename to artifacts/7.0.6/sendy-7.0.6.zip index 53dcb83..95772e9 100644 Binary files a/artifacts/6.0.4/sendy-6.0.4.zip and b/artifacts/7.0.6/sendy-7.0.6.zip differ