Update Dockerfile to revert to PHP 7.0 and adjust Debian repository sources

This commit is contained in:
Frank John Begornia
2025-12-18 14:05:22 +08:00
parent 564719412b
commit c950a72fc8

View File

@@ -1,14 +1,18 @@
# Use PHP 7.3 with Apache (compatible with Laravel 5.0)
FROM php:7.3-apache
# Use PHP 7.0 with Apache (has native mcrypt support for Laravel 5.0)
FROM php:7.0-apache
# Update to use archived Debian repositories
RUN sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list \
&& sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list \
&& sed -i '/stretch-updates/d' /etc/apt/sources.list
# Install system dependencies
RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get install -y --allow-unauthenticated \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
libmcrypt-dev \
zip \
unzip \
libfreetype6-dev \
@@ -17,13 +21,8 @@ RUN apt-get update && apt-get install -y \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath zip tokenizer
# Install mcrypt via PECL (required for Laravel 5.0)
RUN apt-get install -y libmcrypt-dev \
&& pecl install mcrypt-1.0.4 \
&& docker-php-ext-enable mcrypt
# Install PHP extensions (mcrypt is built-in for PHP 7.0)
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath mcrypt tokenizer zip
# Enable Apache mod_rewrite
RUN a2enmod rewrite