GithubHelp home page GithubHelp logo

kittithorn / docker-phpfarm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from splitbrain/docker-phpfarm

0.0 1.0 0.0 94.79 MB

A Dockerfile to build an image running multiple PHP versions on Apache

Home Page: http://www.splitbrain.org/blog/2014-02/02-docker_phpfarm

Groff 71.26% Shell 28.25% PHP 0.49%

docker-phpfarm's Introduction

phpfarm for docker

This is a build file to create a phpfarm setup. The resulting docker image will run Apache on 5 different ports with 5 different PHP versions:

Port PHP Version
8052 5.2.17
8053 5.3.29
8054 5.4.44
8055 5.5.28
8056 5.6.12

Building the image

After checkout, simply run the following command:

docker build -t splitbrain/phpfarm .

This will setup a base Debian system, install phpfarm, download and compile the four PHP versions and setup Apache. So, yes this will take a while. See the next section for a faster alternative.

Downloading the image

Simply downloading the ready made image from index.docker.io is probably the fastest way. Just run this:

docker pull splitbrain/phpfarm

Please note that this image might be somewhat behind from what the Dockerfile would build, but my upload speed is too limited to upload a gigabyte in a timely fashion.

Running the container

The following will run the container and map all ports to their respective ports on the local machine. The current working directory will be used as the document root for the Apache server and the server it self will run with the same user id as your current user.

docker run --rm -t -i -e APACHE_UID=$UID -v $PWD:/var/www:rw -p 8052:8052 -p 8053:8053 -p 8054:8054 -p 8055:8055 -p 8056:8056 splitbrain/phpfarm

Above command will also remove the container again when the process is aborted with CTRL-C. While running the Apache and PHP error log is shown on STDOUT.

Note: the entry point for this image has been defined as ''/bin/bash'' and it will run our ''run.sh'' by default. You can specify other parameters to be run by bash of course.

To Do

  • adjust the build process to have a single file to configure PHP versions and ports
  • optimize the Dockerfile to be more space and update efficient
  • add more common PHP modules to be built

Feedback

This is the first time I ever worked with docker. Pullrequests and hints on how to improve the process are more than welcome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.