Sign inSign up

gsoftcolombia/php5

By gsoftcolombia

•Updated over 8 years ago

Image for Development - Based on ubuntu 16.04 + PHP 5.6 + Apache2; Ideal for Symfony 1.4 Projects

Image
1

889

gsoftcolombia/php5 repository overview

⁠gsoftcolombia/php5

Docker image for PHP5 ideal for development Symfony 1.4 projects.

Important: This image is not designed for production environment.

$ docker pull gsoftcolombia/php5:latest

⁠Usage

⁠Basic Usage
$ docker run -i -t -p 80:80 -v ~/Projects:/var/www/apps -v ~/docker_php5/conf/apache/sites-enabled:/etc/apache2/sites-enabled/ gsoftcolombia/php5

Where ~/Projects is the location of your projects, ~/docker_php5/conf/apache/sites-enabled is the location of your apache virtual host configuration.

  • If you want to stop the container:
Ctrl + C
  • If you want to start an existing container:
# Locate the Contanier ID 
$ docker ps -a
# Start the existing container
$ docker start -i {ID_CONTAINER}
  • If you want to stop an existing container:
$ docker stop {ID_CONTAINER}
⁠Advanced Usage

Please first read the Basic Usage

You can run your container adding /bin/bash for complete access to the container:

$ docker run -i -t -p 80:80 -v ~/Projects:/var/www/apps -v ~/docker_php5/conf/apache/sites-enabled:/etc/apache2/sites-enabled/ gsoftcolombia/php5 /bin/bash

But: You will have to get into the container in order to start apache service.

If you require to link this container with you mysql_dev container please first run your mysql_dev container and then:

$ docker run -i -t -p 80:80 --link mysql_dev_server:mysql_dev_server -v ~/Projects:/var/www/apps -v ~/docker_php5/conf/apache/sites-enabled:/etc/apache2/sites-enabled/ gsoftcolombia/php5 /bin/bash


# Locate the Contanier ID 
$ docker ps -a
# Start the existing container
$ docker start -i {ID_CONTAINER}
# Get into the container console by attaching
$ docker attach {ID_CONTAINER}
# Don't forget to press another ENTER

# Start ApacheD
$ apachectl start

⁠Example

  • Clone your project into ~/Projects.

Let's suppose you have cloned my_project_repo which shall be located in ~/Projects/my_project_repo

  • Create the apache configuration folder:
$ mkdir -p ~/docker_php5/conf/apache/sites-enabled
  • Add your first virtual host:
$ bash -c "cat > ~/docker_php5/conf/apache/sites-enabled/my_project_repo.conf" << 'EOF'
<VirtualHost *:80>
  ServerName my_project_repo.localhost.com
  ServerAlias my_project_repo.localhost.com
  DocumentRoot /var/www/apps/my_project_repo/web
  UseCanonicalName On
  DirectoryIndex index.php
  <Directory /var/www/apps/my_project_repo/web>
    AllowOverride All
    Require all granted
  </Directory>
  Alias /sf /var/www/apps/my_project_repo/lib/vendor/symfony/data/web/sf
  <Directory /var/www/apps/my_project_repo/lib/vendor/symfony/data/web/sf>
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>
EOF

Remember adding my_project_repo.localhost.com to /etc/hosts

⁠Future?

If this thing gets any interest, I'll be happy to take it to the next level of development and implement any feature request that come in. Don't hesitate to contact to us.

Tag summary

Content type

Image

Digest

Size

178.8 MB

Last updated

over 8 years ago

docker pull gsoftcolombia/php5