Setting up a PHP decent development environment

After years of spaghetti code (I’m Italian, I do really know what spaghetti are) I’m trying to set up a decent php development environment.

This is my battleplan:

  • Creating docker-consul official image
  • Docker Toolbox Cleanup Disk Space
  • Docker: Can't use Docker new image file after commiting running container
  • Docker images on different docker versions
  • building oracle docker image on mac os x fails with “This system does not meet the minimum requirements for swap space.”
  • Docker registry and index
    1. install git and docker on my laptop;
    2. create a docker virtual enviroment as much similar as possible to
      the production LAMP (shared) server;
    3. use sshfs to mount the docker VE web server root directory on my laptop;
    4. on the laptop, init a git repository inside the mount point;
    5. use my favourite ide (aptana studio) to create a php project in the mount point directory;
    6. test the code pointing a browser to docker VE ip;
    7. set up a bitbucket account to automatically deploy git commits on production server.

    What do you think about? Any chance it could work?

    Thanks!

  • Can I share docker images between windows and linux?
  • can I use ansible to start docker swarm services without compose?
  • Authentication issue in Docker-MongoDB
  • Kubernetes minion not completely connecting
  • Setup commands for Mesos and Kubernetes on Docker?
  • Docker unsupported manifest mediatype
  • One Solution collect form web for “Setting up a PHP decent development environment”

    I suggest using the official php language docker image:

    https://registry.hub.docker.com/_/php/

    This enables you to create an image that packages your php code, rather than having to map volumes at run-time.

    Example 1 (with Dockerfile)

    ├── build_and_run.sh
    ├── Dockerfile
    └── src
        └── index.php
    

    Dockerfile

    FROM php:5.6-apache
    COPY src/ /var/www/html/
    

    build_and_run.sh

    Script that builds a new container image and launches it:

    docker build -t my-php-app .
    docker run -it --rm --name my-running-app -p 8080:80 my-php-app
    

    Apache is configured to listen on port 8080

    Example 2 (without Dockerfile)

    The php image can also be run without a docker file. Just provide a mapping to the source code locally:

    docker run -it --rm --name my-apache-php-app -v "$(pwd)/src":/var/www/html -p 8080:80 php:5.6-apache
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.