Trying a community maintained image

This commit is contained in:
Finley Ghosh 2025-08-10 11:55:12 +10:00
parent ffc5831f51
commit 09f2db82f5

View file

@ -1,6 +1,5 @@
# This is 99% the same as the prod one. I should do something smarter here.
FROM ubuntu:16.04
# Use a community-maintained PHP 5.6 + Apache image for legacy CakePHP
FROM webdevops/php-apache:5.6
# Set environment variables.
ENV HOME /root
@ -8,32 +7,6 @@ ENV HOME /root
# Define working directory.
WORKDIR /root
# Update apt sources to use old-releases.ubuntu.com for EOL Ubuntu 16.04
RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|http://old-releases.ubuntu.com/ubuntu/|g' /etc/apt/sources.list && \
sed -i 's|http://security.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y upgrade
# Allow apt to use repositories without Release files (for EOL Ubuntu 16.04)
RUN echo 'Acquire::AllowInsecureRepositories "true";' > /etc/apt/apt.conf.d/99allow-insecure
RUN apt-get update -o Acquire::AllowInsecureRepositories=true --allow-unauthenticated
# Install apache, PHP, and supplimentary programs. curl and lynx-cur are for debugging the container.
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 libapache2-mod-php5 php5-mysql php5-gd php-pear php-apc php5-curl php5-imap
# Enable apache mods.
#RUN php5enmod openssl
RUN a2enmod php5
RUN a2enmod rewrite
RUN a2enmod headers
# Update the PHP.ini file, enable <? ?> tags and quieten logging.
# RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php5/apache2/php.ini
#RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php5/apache2/php.ini
ADD conf/php.ini /etc/php5/apache2/php.ini
# Manually set up the apache environment variables
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
@ -46,6 +19,20 @@ ENV COMMIT_SHA=${COMMIT}
EXPOSE 80
# Legacy apt compatibility and install steps for Ubuntu 16.04 (now commented out)
# RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|http://old-releases.ubuntu.com/ubuntu/|g' /etc/apt/sources.list && \
# sed -i 's|http://security.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list
# RUN apt-get update
# RUN apt-get -y upgrade
# RUN echo 'Acquire::AllowInsecureRepositories "true";' > /etc/apt/apt.conf.d/99allow-insecure
# RUN apt-get update -o Acquire::AllowInsecureRepositories=true --allow-unauthenticated
# RUN DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 libapache2-mod-php5 php5-mysql php5-gd php-pear php-apc php5-curl php5-imap
# RUN a2enmod php5
# RUN php5enmod openssl
# RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php5/apache2/php.ini
# RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php5/apache2/php.ini
# ADD conf/php.ini /etc/php5/apache2/php.ini
# Update the default apache site with the config we created.
ADD conf/apache-vhost.conf /etc/apache2/sites-available/cmc-sales
ADD conf/ripmime /bin/ripmime