Image for Development - Based on ubuntu 16.04 + PHP 5.6 + Apache2; Ideal for Symfony 1.4 Projects
889
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
$ 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.
Ctrl + C
# Locate the Contanier ID
$ docker ps -a
# Start the existing container
$ docker start -i {ID_CONTAINER}
$ docker stop {ID_CONTAINER}
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
Let's suppose you have cloned my_project_repo which shall be located in ~/Projects/my_project_repo
$ mkdir -p ~/docker_php5/conf/apache/sites-enabled
$ 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
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.
Content type
Image
Digest
Size
178.8 MB
Last updated
over 8 years ago
docker pull gsoftcolombia/php5