2025-08-10 23:57:52 -07:00
|
|
|
|
2025-08-12 04:04:51 -07:00
|
|
|
|
2025-08-10 23:57:52 -07:00
|
|
|
# Use the official PHP 5.6 Apache image for classic mod_php
|
|
|
|
|
FROM php:5.6-apache
|
2020-07-13 23:00:05 -07:00
|
|
|
|
2025-08-12 04:04:51 -07:00
|
|
|
# Install legacy mysql extension and other common PHP extensions for CakePHP
|
|
|
|
|
RUN docker-php-ext-install mysql mbstring gd curl imap
|
|
|
|
|
|
2020-07-13 23:00:05 -07:00
|
|
|
# Set environment variables.
|
|
|
|
|
ENV HOME /root
|
|
|
|
|
|
|
|
|
|
# Define working directory.
|
|
|
|
|
WORKDIR /root
|
|
|
|
|
|
2025-08-10 23:57:52 -07:00
|
|
|
|
2020-07-13 23:00:05 -07:00
|
|
|
|
|
|
|
|
ARG COMMIT
|
|
|
|
|
ENV COMMIT_SHA=${COMMIT}
|
|
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
2025-08-09 18:55:12 -07:00
|
|
|
# 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
|
|
|
|
|
|
2025-08-12 03:49:59 -07:00
|
|
|
|
|
|
|
|
# Copy vhost config to Apache's sites-available
|
|
|
|
|
ADD conf/apache-vhost.conf /etc/apache2/sites-available/cmc-sales.conf
|
2020-07-13 23:00:05 -07:00
|
|
|
ADD conf/ripmime /bin/ripmime
|
|
|
|
|
|
2025-08-12 03:49:59 -07:00
|
|
|
RUN chmod +x /bin/ripmime \
|
|
|
|
|
&& a2ensite cmc-sales \
|
2025-08-12 03:57:16 -07:00
|
|
|
&& a2dissite 000-default \
|
|
|
|
|
&& a2enmod headers
|
2020-07-13 23:00:05 -07:00
|
|
|
|
|
|
|
|
# Copy site into place.
|
|
|
|
|
ADD . /var/www/cmc-sales
|
|
|
|
|
ADD app/config/database_stg.php /var/www/cmc-sales/app/config/database.php
|
|
|
|
|
RUN mkdir /var/www/cmc-sales/app/tmp
|
|
|
|
|
RUN mkdir /var/www/cmc-sales/app/tmp/logs
|
|
|
|
|
RUN chmod -R 755 /var/www/cmc-sales/app/tmp
|
|
|
|
|
RUN chmod +x /var/www/cmc-sales/run_vault.sh
|
|
|
|
|
|
2025-08-10 01:46:35 -07:00
|
|
|
# Ensure CakePHP tmp directory is writable by web server
|
|
|
|
|
RUN chmod -R 777 /var/www/cmc-sales/app/tmp
|
2025-08-10 23:57:52 -07:00
|
|
|
# No need to disable proxy_fcgi or remove PHP-FPM conf files in this image
|
2020-07-13 23:00:05 -07:00
|
|
|
# By default, simply start apache.
|
|
|
|
|
CMD /usr/sbin/apache2ctl -D FOREGROUND
|