Public Repository

Last pushed: a year ago
Short Description
CentOS 6, Apache 2.2, PHP 5.3
Full Description

CentOS 6, Apache 2.2, PHP 5.3

Old school production environment

  • Additional: supervisord
  • PHP support for: xcache, memcached
  • PHP DB support for: MySQL, PostgreSQL and MongoDB
  • Exposed ports: 80

Docker compose example

version: "2"

services:
  centos6_apache22_php53:
    image: imaghonet/centos6_apache22_php53:stable
    links:
      - db
      - mc
    volumes:
      - your/path/to/httpd.conf:/etc/httpd/conf/httpd.conf  
      - your/path/to/service.conf:/etc/httpd/conf.d/service.conf
      - your/path/to/project/root:/opt/project

    db:
      image: mongo:2
      volumes:
        - /tmp/db:/data/db

    mc:
      image: memcached

Dockerfile

# Pull base image.
FROM centos:6

LABEL "pl.imagho.vendor"="Imagho Polska Sp. z o.o."
LABEL version="1.0"
LABEL description="Production container for Nginx + PHP5 based on Ubuntu 14.04"

MAINTAINER imaghonet <sysops@imagho.net>

# Install base.
RUN \
  rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 && \
  rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 && \
  rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm && \
  yum -y install \
    sudo \
    openssh-clients \
    openssl-devel \
    cronie \
    ntpdate \
    gcc \
    wget \
    supervisor \
    tar \
    bzip \
    autoconf \
    libtool \
    zlib \
    libxml2 \
    libcurl \
    bzip2 \
    libjpeg-turbo \
    libpng \
    freetype \
    libmcrypt \ 
    httpd && \
  echo -e "NETWORKING=yes\nHOSTNAME=centos6" > /etc/sysconfig/network && \
  ln -sf /usr/share/zoneinfo/UTC /etc/localtime

# install php  
RUN \
  yum -y install \
    php \
    php-devel \
    php-mysql php-pgsql php-pdo \
    php-xcache \
    php-mbstring php-intl php-curl php-gd php-pear php-imagick php-imap php-mcrypt php-snmp php-xmlrpc php5-xsl && \
  echo "date.timezone = 'UTC'" >> /etc/php.ini && \
  mv /etc/php.d/xcache.ini /etc/php.d/xcache.bck && \
  sed 's/xcache.admin.enable_auth = On/xcache.admin.enable_auth = Off/g' /etc/php.d/xcache.bck \
    | sed 's/xcache.admin.user = "mOo"/xcache.admin.user = "Sdfskdl5D"/g' > /etc/php.d/xcache.ini && \
  pecl install mongo memcache memcached && \
  rm -rf /var/cache/yum/* && yum clean all && \
  echo "extension=mongo.so" > /etc/php.d/mongo.ini && \
  echo "extension=memcache.so" > /etc/php.d/memcache.ini


# Expose ports.
EXPOSE 80
Docker Pull Command
Owner
imaghonet

Comments (0)