Skip to content

Instantly share code, notes, and snippets.

@taion809
Created October 6, 2013 05:52
Show Gist options
  • Save taion809/6850072 to your computer and use it in GitHub Desktop.
Save taion809/6850072 to your computer and use it in GitHub Desktop.
Apache and PHP5.5 On Docker
FROM ubuntu
MAINTAINER Nicholas Johns "[email protected]"
# Force update
# install wget, curl, and python-software-properties for adding PPA's
# curl and python-software-properties are not necessary but I like them.
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update; apt-get upgrade -y; apt-get install -y wget curl python-software-properties
# Let's install php 5.5
#Add PPA
RUN add-apt-repository ppa:ondrej/php5
# Install PHP 5.5
# As well as curl, mcrypt, and mysqlnd.
RUN apt-get update; apt-get install -y php5-cli php5 php5-mcrypt php5-curl php5-mysqlnd
# Let's set the default timezone in both cli and apache configs
# I live in Japan so let's set it to Asia/Tokyo
# Thanks jtreminio.
RUN perl -pi -e "s#;date.timezone =#date.timezone = Asia/Tokyo#g" /etc/php5/cli/php.ini
RUN perl -pi -e "s#;date.timezone =#date.timezone = Asia/Tokyo#g" /etc/php5/apache/php.ini
# Restart apache2 because we changed configuration directives in php.ini
RUN service apache2 restart
# Expose port 80
EXPOSE 80
# At this point we will stop here, commit and use it as a base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment