cmc-sales/Dockerfile.stg.php

68 lines
2.9 KiB
PHP
Raw Normal View History

2025-08-10 23:57:52 -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:09:21 -07:00
# Install required system libraries and PHP extensions for CakePHP
2025-08-12 04:10:54 -07:00
RUN sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list && \
sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list && \
2025-08-12 04:15:49 -07:00
sed -i '/stretch-updates/d' /etc/apt/sources.list && \
2025-08-12 04:13:46 -07:00
echo 'Acquire::AllowInsecureRepositories "true";' > /etc/apt/apt.conf.d/99allow-insecure && \
echo 'Acquire::AllowDowngradeToInsecureRepositories "true";' >> /etc/apt/apt.conf.d/99allow-insecure && \
2025-08-12 04:10:54 -07:00
apt-get update && \
2025-08-12 04:21:22 -07:00
apt-get install --allow-unauthenticated -y libc-client2007e-dev libkrb5-dev libpng-dev libjpeg-dev libfreetype6-dev libcurl4-openssl-dev libxml2-dev libssl-dev libmcrypt-dev libicu-dev && \
2025-08-12 04:09:21 -07:00
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
2025-08-12 04:21:22 -07:00
docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
2025-11-19 06:19:44 -08:00
docker-php-ext-install mysqli pdo pdo_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 \
2025-08-12 04:35:12 -07:00
&& a2enmod rewrite \
2025-08-12 03:57:16 -07:00
&& a2enmod headers
2020-07-13 23:00:05 -07:00
# Copy site into place.
ADD php/ /var/www/cmc-sales
ADD php/app/config/database_stg.php /var/www/cmc-sales/app/config/database.php
RUN mkdir -p /var/www/cmc-sales/app/tmp
RUN mkdir -p /var/www/cmc-sales/app/tmp/logs
2020-07-13 23:00:05 -07:00
RUN chmod -R 755 /var/www/cmc-sales/app/tmp
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